Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS - can't access page by ip address instead of 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 otherwise 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 

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?

like image 529
KlimczakM Avatar asked Dec 25 '12 10:12

KlimczakM


People also ask

How do I configure IIS to access a website using public IP address?

Go to Start → Administrative Tools → Internet Information Services (IIS) Manager. 3. In the Connections pane of IIS, expand the Sites and select the website which you want to access via IP address.

Can connect with localhost but not IP?

0.1 (or localhost ) but not via the computer's ip address, this means that the server software is configured to listen on the localhost interface only. This is a configuration item and to avoid exposing a potentially unsecure server many server programs come preconfigured to listen on localhost only.

How do I access my IIS website externally?

Click Start and type "IIS". Then click "Internet Information Services (IIS) Manager" to open the "Internet Information Services (IIS) Manager". (Alternatively, you can press "Windows + R" to open RUN and type "inetmgr" to open the "Internet Information Services (IIS) Manager").


1 Answers

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. when I accessed it via localhost:8580 it would translate it to the ipv6 localhost address, and thus would work. Accessing it via ip was a no go. I had to manually bind the address using netsh, then it worked right away. bloody annoying.

Steps:

  1. Open command prompt as administrator
  2. Type the following:

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

like image 177
Optical Phoenix Avatar answered Oct 25 '22 14:10

Optical Phoenix