Host multiple Website on one Amazon EC2 instance Using IIS
Hosting multiple websites on IIS serverHosting multiple websites on Amazon Ec2 using IIS is simple, all you need to do is add a firewall inbound rule, edit the site binding in IIS, add a custom TCP rule in the ec2 security group to support the port you are going to be using.
For example, you have two websites, one is the web app and the other is the Web API, and you need to use the same IIS server, the first thing to do is:
1) Add a custom TCP Rule in the ec2 dashboard under NETWORK & SECURITY tab
2) Open the RDP file and configure open IIS and create the two websites. after creating the websites,
you edit the binding for the two websites using port 81 on the API and port 80 on the web app.
3) Click on the start menu and type firewall, click on the windows firewall and advanced security, click the "Inbound Rule" and create a new rule. Select rule type "Port" and click next, specify port 81, allow connection from "public, private and domain rules".
Now, you have port 81 and 80(default) enabled and you have given the firewall permission to use port 81. The next thing to do is to open your browser and test it.
Web: http://ec2-ip.compute.amazonaws.com/home/index (No need to specify port 80)
And that is all!!!