You need to enable JavaScript to run this app.
Elastic Compute Service

Elastic Compute Service

Copy page
Download PDF
Building multiple websites
Setting up multiple websites (Windows)
Copy page
Download PDF
Setting up multiple websites (Windows)
You can host multiple websites on a single ECS instance, enabling unified management and resource sharing for small-scale sites, such as multiple WordPress blogs and static web pages.​
Prerequisites​
  • Web environment deployment​
  • Software versions​
  • Operating system: In the example provided in this topic, Windows 2022 is used.​
  • IIS: Internet Information Services (IIS) is a type of server software developed by Microsoft for hosting and providing web services. In the example provided in this topic, IIS 10.0 is used.​
  • MySQL/MariaDB: A database management system. In the example provided in this topic, MySQL 8.0 is used.​
  • PHP: A server-side scripting language embedded in HTML documents. In the example provided in this topic, PHP 7.4 is used.​
Procedure​
This topic describes how to set up two static web pages on an ECS instance running the Windows operating system.​
Step 1: Create a static Web page file​
  1. Log in to the Windows instance where a web environment is set up. Learn more.​
  1. Enter the C:\wwwroot folder.​
tip​
After you install the IIS web server, this folder is created by default as the root directory of the server.​
  1. Create the windows-page-1 and windows-page-2 folders.​
  1. Click the "View" button in the top menu bar, and check "File name extensions".​
  1. Create site page files.​
  • Site page 1:​
  1. In the windows-page-1 folder, create a text file named page1.php.​
  1. Click the "Yes" button in the pop-up window to complete the creation process.​
  1. Open the page1.php file with Notepad, and enter the following content.​
  • ​
    <?php​
    echo "Welcome to Test Page 1";​
    ?>​
    ​
  1. Save and exit the file.​
  • Site page 2:​
  1. In the windows-page-2 folder, create a text file named page2.php.​
  1. Click the "Yes" button in the pop-up window to complete the creation process.​
  1. Open the page2.php file with Notepad, and enter the following content into it.​
  • ​
    <?php​
    echo "Welcome to Test Page 2";​
    ?>​
    ​
  1. Save and exit the file.​
Step 2: Create a website​
  1. Log in to the Windows instance where the web environment is set up. For more information, see Logging in to Windows instances.​
  1. Click the "Start" icon, and then click the "Server Manager" button.​
  1. In the server manager window, click "Tools > Internet Information Services (IIS) Manager".​
  1. In the left pane of the "Internet Information Services (IIS) Manager" window, select "<Host Name> (e.g., IV-BXJDxxxxx) > Sites". Then, create and configure the site information.​
tip​
In the example provided in this topic, two test sites and their web content are created for reference only. In actual site deployment scenarios, you need to configure real domain names, hostnames, physical paths, and other related information.​
  • Test site 1​
  1. Click the "Add Website" button.​
  1. In the "Add Website" window, configure information described in the following table.​
  • Parameter descriptions:​
  • ​
    Parameter​
    Description​
    Sample value​
    Site name (S)​
    The name used to identify and recognize a website.​
    windows-page-1​
    Application pool (L)​
    Each website can be associated with a specific application pool, which determines the runtime environment of the website application and isolates its resources from those of other applications.​
    windows-page-1​
    Physical path (P)​
    The root directory or content storage location for the website.​
    C:\wwwroot\windows-page-1​
    Host name​
    You can configure different hostnames (domain names) for multiple websites on the same IP address. This allows different websites to be accessed based on different domain names.​
    winpage1.com​
    ​
  1. Click "OK" to complete the creation.​
  • Test site 2​
  1. Click the "Add Website" button.​
  1. In the "Add Website" window, configure information described in the following table.​
  • Parameter descriptions:​
  • ​
    Parameter​
    Description​
    Sample value​
    Site name (S)​
    The name used to identify and recognize a website.​
    windows-page-2​
    Application pool (L)​
    Each website can be associated with a specific application pool, which determines the runtime environment of the website application and isolates its resources from those of other applications.​
    windows-page-2​
    Physical path (P)​
    The root directory or content storage location for the website.​
    C:\wwwroot\windows-page-2​
    Host name​
    You can configure different hostnames (domain names) for multiple websites on the same IP address. This allows different websites to be accessed based on different domain names.​
    winpage2.com​
    ​
  1. Click "OK" to complete the creation.​
Step 3: Configure the local hosts file (optional)​
The domain name of the test site created in this topic is not a valid domain name. Other PCs that need to access the test site must configure the IP mapping in their respective hosts file.​
tip​
If the "Host Name" value you specified when you create a site in the IIS web server is a valid domain name, skip this step.​
  1. Log in to the local PC that needs to access the test site.​
tip​
In the example provided in this topic, another Windows instance that can access the Internet (not used for hosting a website) is used.​
  1. Go to the C:\Windows\System32\drivers\etc directory.​
  1. Back up the hosts file.​
tip​
We recommend that you copy and save the hosts file as a backup. After the test is complete, you can use the backup to restore the hosts file to its original state.​
  1. Open the hosts file with Notepad, and add the following content at the end of the file.​
  • ​
    <ECS instance Elastic IP (EIP)> winpage1.com​
    <ECS instance Elastic IP (EIP)> winpage2.com​
    ​
  1. Save and close the file.​
  1. Click the "Start" icon, and select "Windows Administrative Tools > Command Prompt".​
  1. Execute the following command in the command line to make the hosts configuration take effect immediately.​
  • ​
    ipconfig /flushdns​
    ​
Step 4: Access the web page​
  1. Log in to the local PC that has the local hosts file configured.​
  1. Access the test web page in the browser and verify whether it can be accessed.​
  • Web page 1​
  • ​
    winpage1.com/page1.php​
    ​
  • Web page 2​
  • ​
    winpage2.com/page2.php​
    ​
  1. At this point, multiple websites are set up.​
Step 5: Enable HTTPS for the website (optional)​
When a user accesses your website over the HTTP protocol, the browser warns the user that the connection is not secure. We recommend that you enable HTTPS secure communication for your website. This ensures encrypted data transmission between users and your website, effectively defending against network hijacking, information leakage, and other threats.​
To enable HTTPS, you need to deploy an SSL certificate on your website. You can apply for a free SSL certificate in the Volcano Engine Certificate Center. For more information, see Applying for free certificate and Downloading and installing certificate.​
Last updated: 2026.06.18 19:52:58