This article describes how to use Internet Information Services (IIS) to build multiple websites on a Windows Elastic Compute Service (ECS) instance. In this article, the instance runs Windows Server 2012 R2 64-bit.
This tutorial is intended for users who are familiar with Windows and want to optimize the O&M process by making efficient use of resources and managing sites in a centralized manner. For example, you can configure multiple blogging platforms of different categories or build multiple websites to handle complex business tasks on an instance.
In this tutorial, IIS is used to simultaneously build the windows-testpage-1
and windows-testpage-2
websites and configure different domain names on the same port to access the websites.
In this article, the following instance configurations are used:
1. Connect to the instance on which the web environment is deployed. For more information, see Connect to a Windows instance by using password authentication.
2. On the desktop, click This PC and go to the C:wwwroot path in the default root directory.
3. Create the windows-testpage-1
and windows-testpage-2
folders.
4. Open the windows-testpage-1
folder, create the test1.php file in the folder, and then enter the following content in the file:
<?php
echo "<title>Test-1</title>";
echo "windows-test-1";
?>
5. Open the windows-testpage-2
folder, create the test2.php file in the folder, and then enter the following content in the file:
<?php
echo "<title>Test-2</title>";
echo "windows-test-2";
?>
1. In the taskbar, click the Server Manager iconserver .
2. In the top navigation bar, choose Tools > Internet Information Services (IIS) Manager.
3. In the left-side navigation pane of IIS Manager, click the name of the server and click Sites.
4. In the Actions section on the right, click Add Website. Add the windows-testpage-1
website and click OK.
The following figure shows how to configure the website.
The following list describes how to configure the parameters:
windows-testpage-1
.windows-testpage-1
website.test1.com
domain name as the hostname.5. In the Actions section on the right, click Add Website. Add the windows-testpage-2
website and click OK.
The following figure shows how to configure the website.
The following list describes how to configure the parameters:
windows-testpage-2
.windows-testpage-2
website.test2.com
domain name as the hostname.The following figure indicates that the websites are added.
In this tutorial, the domain names are used only for test purposes. You must configure IP mapping in the local hosts file. If you use the actual server domain names when you configure the websites, skip this step. In this tutorial, the local physical server uses the Windows operating system.
1. Go to the C:WindowsSystem32driversetc directory.
2. Copy the hosts file for backup.
Retain the hosts - copy file, which can be used to restore the hosts file to the initial state after the test is complete.
3. Modify the hosts file.
Append the following content to the end of the file, save the file, and then exit the file:
<Public IP address of the instance> test1.com
<Public IP address of the instance> test2.com
4. Go back to the Windows desktop and press Win+R
.
5. In the Run dialog box, enter cmd
and click OK.
6. Run the following command in the command line to make the configurations of the hosts file immediately take effect:
ipconfig /flushdns
You can access the two test websites from a browser on the local host.
test1.com/test1.php
in the address bar of the browser and press the Enter key. The windows-testpage-1
website is displayed, as shown in the following figure.test2.com/test2.php
in the address bar of the browser and press the Enter
key. The windows-testpage-2
website is displayed, as shown in the following figure.Multiple websites are built. In your actual operations, you need only to make sure that the hostnames and project paths are correctly configured to access your websites. You can install SSL certificates in IIS. For more information, see Install SSL certificates on IIS servers.
1,078 posts | 265 followers
FollowAlibaba Cloud Community - January 10, 2024
Alibaba Clouder - August 17, 2020
Marketplace - November 23, 2018
Alibaba Cloud Community - November 30, 2021
Alibaba Clouder - June 7, 2018
Alibaba Cloud Community - January 10, 2024
1,078 posts | 265 followers
FollowElastic and secure virtual cloud servers to cater all your cloud hosting needs.
Learn MoreAlibaba Cloud Function Compute is a fully-managed event-driven compute service. It allows you to focus on writing and uploading code without the need to manage infrastructure such as servers.
Learn MoreHigh Performance Computing (HPC) and AI technology helps scientific research institutions to perform viral gene sequencing, conduct new drug research and development, and shorten the research and development cycle.
Learn MoreA HPCaaS cloud platform providing an all-in-one high-performance public computing service
Learn MoreMore Posts by Alibaba Cloud Community