ChG ChG - 4 months ago 11
ASP.NET (C#) Question

How to access multiple website using different bindings on IIS 7.5

How can I access different websites hosted on my local IIS 7.5 (using different bindings) from my ipv4 address?

My system32\drivers\etc\host file has my binding names mapped to 127.0.0.1

In IIS, I have the normal "Default Web Site". Its binding hostname is empty, set to all unassigned ip address and port 80. On my network, I can access this site using the server ipv4 address like so :

http://192.168.2.1/mySubSite/index.html
where mySubSite is a child folder of the "Default Web Site". I can also access it locally using
http://localhost/mySubSite/index.html


If I setup a second website in IIS using the same binding as the "Default Web Site" but using a hostname (say "site2"), I can access it locally using
http://site2/mySubSite/index.html
.

How can I access this second site on my network the same way I access the "Default Web Site" using the ip address? Is it possible?

Answer

the easiest way to do this is to change the port binding on each website. This takes minimal configuration and you can place a website on any port you want (I recommend ports over 1024...to a maximum of 65000)

For example, your default site will automatically be on port 80. Place site 2 on Port 2000. Then you can access your default site like you have above, and you can access site 2 with a similar url like http://192.168.2.1:2000/mySubSite/index.html. Notice the port is specified in the url using the :[port] at the end.