1

On a Windows Server 2012R2 I can't open the local hosted site via 127.0.0.1, via localhost works. Ping of 127.0.0.1 works also.

On a Windows Server 2008R2 it works without any Problems.

What could cause this issue?

Dave M
  • 4,494
  • 21
  • 30
  • 30
GiXXeR
  • 11
  • 1
  • 1
  • 2
  • 1
    Are you sure the web server is running? You'll basically always be able to ping 127.0.0.1, it doesn't tell us much other than your TCP/IP stack isn't dead. – Michael Bailey Aug 24 '15 at 14:50
  • Are you sure it is bound to 127 and not the servers IP address? Also what is the Web Server? – Zapto Aug 24 '15 at 14:55
  • It should be bound to all interfaces if it's a hosted site. So *:80 – Michael Bailey Aug 24 '15 at 14:56
  • I'm using IIS and it's bound to *:80 – GiXXeR Aug 24 '15 at 15:02
  • What is the particular error in browser? For instance in chrome it usually spits out TIMED_OUT or NXDOMAIN or something – Michael Bailey Aug 24 '15 at 16:12
  • Are you sure that the web server is listening on 127.0.0.1? Try opening up a cmd prompt and typing 'netstat -an' and have a look at what services are listening on what port. – qovert Aug 24 '15 at 14:54
  • 3 people just said the same thing within the same minute :'D – Michael Bailey Aug 24 '15 at 14:56
  • That's how you know you troubleshooting steps are 'best practice' ;) – qovert Aug 24 '15 at 14:58
  • The webserver is 100% running and with netstat -an i can find TCP [::]:80 and it's listening, but not 127.0.0.1:80 is that's mby a problem? – GiXXeR Aug 24 '15 at 15:00
  • [::]:80 means that your web server is listening on all ipv6 addresses. If you don't have an entry for 127.0.0.1:80 or 0.0.0.0:80 that would definitely be your issue! – qovert Aug 24 '15 at 19:56
  • I'm getting 401.2 Unauthorized. For 0.0.0.0:80 i've got an entry. – GiXXeR Aug 25 '15 at 08:19
  • Problem solved, 127.0.0.1 wasn't identified as intranetzone... Dunno why... Added it manually and it works... – GiXXeR Aug 25 '15 at 08:24

2 Answers2

1

Possible solution:

Check (drive letter)\Windows\system32\drivers\etc\hosts to see if it has an entry resolving 127.0.0.1 to localhost. If it does not, add it (default hosts file has inline comments to guide you). Also run ipconfig /flushdns before attempting it again.

Additionally check your firewall. I'm unaware of any cases it's actually ever blocked loopback (don't even know why it would) but may as well test it.

Michael Bailey
  • 462
  • 2
  • 12
0

I could ping localhost and firewalls weren't on. I ran F12 debugger while it wasn't working and for some reason IE would abort without ever accessing the localhost site. I could access external sites successfully from the server. I could also access the server's site from a browser on a different system. However, I couldn't access sites hosted by the server from the server's browser whether I used localhost, the servername, the IP or FQDN.

To get it working, I did the following:

1) Set the back connection host names as described in the below article. At a minimum, you'd want to add localhost and the servername to the BackConnectionHostNames multistring value.

IIS Admin, and IIS Restart after the change.

https://support.microsoft.com/en-us/help/896861/you-receive-error-401.1-when-you-browse-a-web-site-that-uses-integrated-authentication-and-is-hosted-on-iis-5.1-or-a-later-version

2.Click Start, click Run, type regedit, and then click OK.
3.In Registry Editor, locate and then click the following registry key: 
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0

4.Right-click MSV1_0, point to New, and then click Multi-String Value.
5.Type BackConnectionHostNames, and then press ENTER.
6.Right-click BackConnectionHostNames, and then click Modify.
7.In the Value data box, type the host name or the host names for the sites that are on the local computer, and then click OK.

2) Disabled IE Enhanced Security Mode. (Go to Server manager -> Click Local Server on the left pane, and then in the server properties click the link next to IE Enhanced Security Configuration. Then turn it off for users and administrators.

3) Then, I had to run IE as an administrator by pinning IE to the task bar, right click on the task bar icon, then right click on the internet explorer icon in the popup menu, and clicking Run as administrator.

a. Open the localhost site that you want to access.

4) After that, I closed the IE instance that was an administrator and tried accessing the localhost site with regular privileges and was able to access the site.

NOTE: You may be able to open IE as administrator before doing any of the above steps to get the browser to browse localhost. However, the above steps made it so I could do it without having to run IE as administrator.

WWC
  • 101
  • 2