[英]IIS - can't access page by ip address instead of localhost
I'm trying to publish ClickOnce
application and test it locally.我正在尝试发布
ClickOnce
应用程序并在本地进行测试。 I want to provide installation link so I need to update location with an IP address otherwise I won't be able to install it (because localhost
is translated into computer name and it's not accessible).我想提供安装链接,所以我需要使用 IP 地址更新位置,否则我将无法安装它(因为
localhost
被转换为计算机名称并且无法访问)。 The problem is, that on my IIS
I can access my page only by using localhost
in the address.问题是,在我的
IIS
我只能通过在地址中使用localhost
来访问我的页面。
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
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.我将
Windows 7
和Visual Studio 2012
与IIS Express 8.0
,但我在Visual Studio 2010
上尝试了相同的方法,它是ASP.NET server
,但仍然失败。 I have my firewall turned off.我关闭了防火墙。
Do you have any ideas what can be wrong?你有什么想法可能是错的吗?
So I had this same problem with WSUS and it turned out that IIS 8.5 was not binding to my ipv4 ip address, but was binding to ipv6 address.所以我在 WSUS 上遇到了同样的问题,结果是 IIS 8.5 没有绑定到我的 ipv4 ip 地址,而是绑定到了 ipv6 地址。 when I accessed it via localhost:8580 it would translate it to the ipv6 localhost address, and thus would work.
当我通过 localhost:8580 访问它时,它会将其转换为 ipv6 localhost 地址,因此可以工作。 Accessing it via ip was a no go.
通过 ip 访问它是不行的。 I had to manually bind the address using netsh, then it worked right away.
我必须使用 netsh 手动绑定地址,然后它立即起作用。 bloody annoying.
该死的烦人。
Steps:脚步:
netsh http add iplisten ipaddress (IPADDRESSOFYOURSERVER)
that's it.而已。 You should get:
你应该得到:
IP address successfully added
I found the commands here https://serverfault.com/questions/123796/get-iis-7-5-to-listen-on-ipv6我在这里找到了命令https://serverfault.com/questions/123796/get-iis-7-5-to-listen-on-ipv6
The IIS is a multi web site server. IIS 是一个多网站服务器。 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:以下是您需要遵循的步骤:
How to configure multiple IIS websites to access using host headers? 如何配置多个 IIS 网站以使用主机头访问?
In general, open your web site properties, locate the Ip Address and near its there is the advanced, "multiple identities for this web site".通常,打开您的网站属性,找到 IP 地址,在其附近有高级的“此网站的多重身份”。 There you need ether to add all income to this site with a star: "*", ether place the names you like to work with.
在那里,您需要以太币将所有收入添加到带有星号的站点:“*”,以太币放置您喜欢使用的名称。
Maybe it helps someone too:)也许它也可以帮助某人:)
I'm not allowed to post images, so here goes extra link to my blog.
我不允许张贴图片,所以这里有额外的链接到我的博客。 Sorry.
对不起。
IIS webpage by using IP address 使用IP地址的IIS网页
In IIS Management : Choose Site , then Bindings .在 IIS 管理中:选择站点,然后选择绑定。
Add添加
Check the settings of the browser proxy .检查浏览器代理的设置。 For me it helped , traffic was directed outside.
对我来说它有帮助,交通被引导到外面。
In my case it was because I was using a port other than the default port 80. I was able to access the site locally using localhost but not on another machine using the IP address.就我而言,这是因为我使用的是默认端口 80 以外的端口。我能够使用 localhost 在本地访问该站点,但不能使用 IP 地址在另一台机器上访问。
To solve the issue I had to add a firewall inbound rule to allow the port.为了解决这个问题,我必须添加一个防火墙入站规则来允许端口。
尝试禁用 Windows 防火墙,它对我有用,但就我而言,我能够通过 127.0.0.1 访问 IIS
I was trying to access my web pages on specific port number and tried much things, but I've found the port was filtered by firewall.我试图通过特定端口号访问我的网页并尝试了很多东西,但我发现该端口被防火墙过滤了。 Just added a bypass rule and everything was done.
刚刚添加了一个绕过规则,一切都完成了。
Maybe help someone!也许可以帮助某人!
In IIS Manager, I added a binding to the site specifying the IP address.在 IIS 管理器中,我添加了一个绑定到指定 IP 地址的站点。 Previously, all my bindings were host names.
以前,我所有的绑定都是主机名。
Follow the below steps -请按照以下步骤操作 -
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.