Omnia shows you how to
host multiple websites
using a single EC2 instance

I want to host multiple public websites on a single Amazon EC2 Windows Server instance. How can I do this?

You can configure this with Internet Information Services (IIS) using multiple host names on an EC2 Windows Server instance.

If you have more than one website, you can host them in IIS on the same EC2 Windows Server instance. IIS differentiates between websites by using bindings, which are a combination of the protocol type, IP address, port, and host name. To avoid IP and port conflicts, you must add a host name.

Note: If you haven't already done so, set up and configure your first website. For additional information, see How do I publicly host my website on an EC2 Windows instance using IIS?

Add a host name using IIS Manager and update your local hosts file:

1. Open IIS Manager, and in the Connections pane, choose the site that you want to add a host name to.

2. In the Actions pane, choose Bindings, Edit, enter a name in the host name field, and then choose OK.

3. Update the hosts file with the host name to access the website locally from the IIS server.

  • Open a text editor using the Run as Administrator option, and then open the hosts file in the C:\Windows\System32\drivers\etc directory.
  • Enter the Private IP address of the EC2 instance and the host name of your website, and then save the file.

4. Repeat steps 1-3 for each additional website.

Now multiple websites can be accessed using the private IP address locally from the hosts file on the same EC2 Windows Server instance. For public access, add the public IP address in your public hosted zone through your web provider or with Amazon Route 53.

Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center.

Published: 2017-04-11

Updated: 2018-08-31