DEV Community

charles
charles

Posted on

1 1

Hosting multiple websites on Ec2 using IIS

Hosting 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 and set the port to 81

2) 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) Add a firewall inbound rule to support access from port 81

For a full-detailed information, check this out

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (1)

Collapse
 
vbbalaji profile image
vbbalaji

The challenge in this case is if the second is a website, users will not enter :81 and you cannot advertise your site on websites/business card/boards as secondsite.com:81. How can I have two sites of different domain on same EC2 instance? For e.g. T1.com and A1.com

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more