Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run multiple sites from one IP in IIS

I have a box with Windows Server 2008 and IIS 7, and I'm using an ASP.NET app. I am trying to run multiple sites from one IP, but I can't access the sites from the outside. I can only access the Default website from outside but when I want to access the second one it does not work.

The second one should run on the http://ip:81 and the default one is on 80. They both run fine locally on the box and I have added a rule on the firewall to allow all inbound.

like image 376
Jacob O'Brien Avatar asked Nov 21 '12 09:11

Jacob O'Brien


People also ask

Can you run multiple websites on a single IP address?

You can indeed host many many websites on the same IP address. Though, if you want your website to use secure HTTP (HTTPS), then you have to use a unique IP address for that web site only.

How do I make multiple websites with the same IP address?

Name-based virtual hosting is the most commonly used method to host multiple websites on the same IP address and Port. You will need valid domain names to host multiple websites using name-based virtual hosting.

How configure multiple sites in IIS?

Configuring multiple sites on a local IIS serverOpen your Internet Information Services (IIS) Manager console (Start -> Control Panel -> Administrative tools -> Internet Information Services (IIS) Manager). In the tree, right-click Sites and select Add Web Site. Enter the following details: Site name: mysite.com.


1 Answers

You can use the same port 80 for all the sites. It's all about the bindings. You need to bind each site to a different host name:

www.domain.com
site2.domain.com
www.anotherdomain.com

etc.

You can do this by specifying the binding when creating a site. Then make sure you have configured DNS records to point at the same IP.

You can also setup a catchall DNS entry for a domain and point it at the IP of the server, then every time you create a site you can simply pick a new subdomain name at it will work straight away.

like image 75
Richard Avatar answered Oct 03 '22 03:10

Richard