IIS - 无法通过ip地址而不是localhost访问页面 [英] IIS - can't access page by ip address instead of localhost
问题描述
我正在尝试发布 ClickOnce
应用程序并在本地测试它。我想提供安装链接,所以我需要用IP地址更新位置,除非我无法安装它(因为 localhost
被翻译成计算机名称而不是无障碍)。问题是,在我的 IIS
上,我只能在地址中使用 localhost
访问我的页面。
I'm trying to publish ClickOnce
application and test it locally. I want to provide installation link so I need to update location with an IP address unless I won't be able to install it (because localhost
is translated into computer name and it's not accessible). The problem is, that on my IIS
I can access my page only by using localhost
in the address.
http://localhost:9995/publish/Publish.htm <-- working
http://192.168.1.104:9995/publish/Publish.htm <-- not working (my IP address)
http://my_pc_name:9995/publish/Publish.htm <-- not working
http://127.0.0.1:9995/publish/Publish.htm <-- even that is not working
我正在使用 Windows 7
和 Visual Studio 2012
与 IIS Express 8.0
,但我在 Visual Studio 2010
上尝试了相同的操作,它是 ASP.NET服务器
仍然失败了。我关闭了防火墙。
I'm using Windows 7
and Visual Studio 2012
with IIS Express 8.0
, but I tried the same on Visual Studio 2010
and it's ASP.NET server
and still failed. I have my firewall turned off.
你有什么想法可能出错吗?
Do you have any ideas what can be wrong?
推荐答案
IIS是一个多网站服务器。方式与主机标题名称截然不同。因此,您需要在您的网站上进行设置。
The IIS is a multi web site server. The way is distinct the site is by the host header name. So you need to setup that on your web site.
以下是您需要遵循的步骤:
Here is the steps that you need to follow:
如何:使用主机标题名称来托管多个站点
使用主机头用于托管多个网站的名称
通常,打开您的网站属性,找到IP地址,并在其附近有高级的多个身份这个网站。在那里你需要以太网将所有收入添加到这个站点,并带有一个星号:*,以及你想要使用的名字。
In general, open your web site properties, locate the Ip Address and near its there is the advanced, "multiple identities for this web site". There you need ether to add all income to this site with a star: "*", ether place the names you like to work with.
这篇关于IIS - 无法通过ip地址而不是localhost访问页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!