从IIS 7中本地网络内的另一台计算机访问本地网站 [英] Accessing a local website from another computer inside the local network in IIS 7

查看:180
本文介绍了从IIS 7中本地网络内的另一台计算机访问本地网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以这里是场景:

Ok, so here is the scenario:

我在运行IIS 7的本地网络中有计算机A 。我添加了一个新网站,让我们说通过IIS管理器samplesite.local,并使用以下新行编辑%systemroot%\ systemL \ drive &\\ etc \中的 hosts 文件:

I have computer A inside my local network running IIS 7. I added a new website, let's say samplesite.local, through IIS Manager, and edited the hosts file inside %systemroot%\system32\drivers\etc\ with this new line:

127.0.0.1 samplesite.local

127.0.0.1 samplesite.local

因此,在计算机A中运行的浏览器中,如果我在地址栏中键入samplesite.local,点击Enter,一切正常。我可以访问该网站。

So, in a browser running in computer A, if I type samplesite.local in the address bar and hit Enter, everything works fine. I can access the website.

现在,我想从其他本地计算机访问此网站,例如计算机B iPad ,不是来自外部世界,而是来自同一个本地网络。

Now I wanted to access this website from other local computers, say, computer B or an iPad, not from the outside world, but from inside the same local network.

有什么想法吗?

编辑:
计算机A的IP是192.168.1.100,并且samplesite.local在端口80上运行。但是,如果我在任何计算机的浏览器地址栏中键入192.168.1.100,我' m进入默认的IIS网站,即带有IIS徽标的网站,其物理地址为C:\inetpub \ www.root \,而不是samplesite.local。

Computer A's IP is 192.168.1.100, and samplesite.local is running on port 80. However, if I type 192.168.1.100 in any computer's browser's address bar, I'm taken to the default IIS website, the one with the IIS logo, whose physical address is C:\inetpub\wwwroot\, not to samplesite.local.

推荐答案

为您的网站添加两个绑定,一个用于本地访问,另一个用于LAN访问,如下所示:

Add two bindings to your website, one for local access and another for LAN access like so:

打开IIS并选择您的从左侧面板本地网站(您要从本地网络访问):

Open IIS and select your local website (that you want to access from your local network) from the left panel:


Connections> server(user-pc)> sites >本地网站

Connections > server (user-pc) > sites > local site

操作标签下右侧面板上打开绑定
添加以下绑定:

Open Bindings on the right panel under Actions tab add these bindings:


  1. 本地:

  1. Local:


Type: http
Ip Address: All Unassigned
Port: 80
Host name: samplesite.local



  • LAN:

  • LAN:


    Type: http
    Ip Address: <Network address of the hosting machine ex. 192.168.0.10>
    Port: 80
    Host name: <Leave it blank>
    



  • Voila ,您应该可以使用主机的LAN IP地址(上例中的192.168.0.10)作为站点网址,从本地网络上的任何计算机访问该网站。

    Voila, you should be able to access the website from any machine on your local network by using the host's LAN IP address (192.168.0.10 in the above example) as the site url.

    注意:

    如果您想使用主机名(如samplesite.local)而不是IP地址从LAN访问网站,将主机名添加到本地网络计算机上的hosts文件中(主机文件可以在Windows中的C:\ WindowsD.System32 \drivers \ etcc \ hosts中找到或者ubuntu中的/ etc / hosts

    if you want to access the website from LAN using a host name (like samplesite.local) instead of an ip address, add the host name to the hosts file on the local network machine (The hosts file can be found in "C:\Windows\System32\drivers\etc\hosts" in windows, or "/etc/hosts" in ubuntu):


    192.168.0.10 samplesite.local

    192.168.0.10 samplesite.local

    这篇关于从IIS 7中本地网络内的另一台计算机访问本地网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆