简体   繁体   中英

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?

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.

Yes, you can have multiple sites on the same IP address and port. It is called binding by domain name.

Open ISS and go to your first default site (one that is functional) and then go to edit bindings. You will see by default it states "http: Port 80 IP Address *"

Notice the hostname is blank? This is where you can tie a domain name to that exact port. Fill out domain name on both your site bindings. This means when someone comes in from that exact domain name, it knows where to forward traffic too. If port 80 inbound doesn't match either of those two domain names, it will default to w/e site has no bindings such as the "default site".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM