如何使用IIS 7.5上的不同绑定访问多个网站 [英] How to access multiple website using different bindings on IIS 7.5
问题描述
如何从我的ipv4地址访问本地IIS 7.5上托管的不同网站(使用不同的绑定)?
How can I access different websites hosted on my local IIS 7.5 (using different bindings) from my ipv4 address?
我的system32\drivers\etc\host文件将我的绑定名称映射到127.0.0.1
My system32\drivers\etc\host file has my binding names mapped to 127.0.0.1
在IIS中,我有正常的默认网站。它的绑定主机名为空,设置为所有未分配的IP地址和端口80.在我的网络上,我可以使用服务器ipv4地址访问此站点,如下所示: http://192.168.2.1/mySubSite/index .html
其中mySubSite是默认网站的子文件夹。我也可以使用本地访问它:http://localhost/mySubSite/index.html
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
如果我设置了IIS中的第二个网站使用与默认网站相同的绑定但使用主机名(比如site2),我可以使用 http://site2/mySubSite/index.html <在本地访问它/ code>。
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
.
如何使用ip地址访问默认网站,我如何在网络上访问第二个站点?是否可能?
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?
推荐答案
最简单的方法是更改每个网站上的端口绑定。这需要最少的配置,你可以在任何你想要的端口上放置一个网站(我建议端口超过1024 ...最多65000)
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)
例如,你的默认站点将自动在端口80上。将站点2放在端口2000上。然后您可以像上面一样访问您的默认站点,并且您可以使用类似的URL访问站点2,如 http://192.168。 2.1:2000 / mySubSite / index.html中
。请注意,端口是在URL中使用末尾的[port]指定的。
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.
这篇关于如何使用IIS 7.5上的不同绑定访问多个网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!