Localhost connection issues list

I’ve been hanging in the forums and newsgroups.  There have been a variety of posts stating, I can’t browse Localhost or http://127.0.0.1   There has not been any pattern to resolve it.  This post is dedicated to this very common issue.  If you have a solution not listed, please provide a comment and we’ll add it to the list.  Hope this helps if you are having this problem.


1) Make sure the WWW service is enabled – Go to the Control Panel >> Administrative Tools >> Services applet.  Launch this and see if the World Wide Publishing Service is started.


2) Verify you can ping localhost and resolve to 127.0.0.1


3) Try adding localhost to trusted sites in IE.  Also turn off HTTP Friendly errors.  This is Internet tools > Advanced tab of Internet Tools?  When unchecked, it can display a more accurate error.  If you are posting a question in a forum or newsgroup, please post the error.


4) Do you get this behavior with Firefox and IE both?


5) Open a command prompt, type netstat -an -p tcp and see if 0.0.0.0:80 listed or something with :80 listed. This point goes along with #1.  If you see the WWW service not started.  There is another process or program using Port 80.  Port 80 is used by default for serving webpages.


6) If IIS is not started and you see port 80 listed in #5.  It could be another service, such as Skype as another poster mentioned taking up the TCP port 80


7) Verify you don’t have a virus software or spyware program blocking access.


8) Anything in the event logs showing an error.  Look in the Control panel >> Administrative Tools >> EventViewer.  See if there are any errors in the SYSTEM, SECURITY or APPLICATION log that relate to anything with the WWW service.  Or any errors that seem to relate to your issue.  if so, you can search Google or support.microsoft.com to see if they have any suggestions.   Also, if you find an error you can post it back here.


9) Run Filemon or Process Monitor from sysinternals.  This can help show which files or folders don’t have access. – Process monitor is a free utility provided by Microsoft to help identify if there are folder or file level access permissions.  Here is an article on using this utility.


http://www.microsoft.com/technet/sysinternals/utilities/processmonitor.mspx


10) Windows firewall could be blocking the port.  You can either turn it off temporarily or run ‘netsh firewall set portopening TCP 80 “HTTP Port’ from the command prompt.  Note: The netsh command requires elevated command prompt.



11) Jayson Knight metnioned he had to sometimes you need to add 127.0.0.1 localhost to your hosts file.


12) Steve Smith ran into another similar issue with a loopback ‘lockdown’:


http://aspadvice.com/blogs/ssmith/archive/2007/02/09/SQL-Reporting-Services-401-Error.aspx


13) Mike Volodarsky – A while ago, I had made a post to help troubleshoot these types of errors for IIS7 (localhost, and remote) – it may also be useful in troubleshooting these errors:


http://mvolo.com/blogs/serverside/archive/2006/10/16/Where-did-my-IIS7-server-go_3F00_-Troubleshooting-guide-for-_2200_server-not-found_2200_-errors.aspx.


14) Take a look at KB896861 (http://support.microsoft.com/kb/896861)


15) For 403 and related status code issues. http://support.microsoft.com/kb/318380  – Tom Kaminski, Microsoft IIS MVP


16) Setting up localhost so I can “Make your website public” by Kristofer Gafvert


17) Remove “::1” from your local hosts file.  for some reason, this was in my local hosts file recently. 


18) On an XP machine – IPv6 was instaleld and IPV6 became the default protocol for my NIC and Wireless adapter. After uninstalling IPV6 everything has worked fine. All of the problems that I was seeing were apparently related to IPV6s loopback response of ::1: when the processes were attempting to access //localhost. Though there were no entries in the host or lmhosts file IPV6 was still responding in that manner.


19) Port 80 was in-use.  McAfee’s ePO was using port 80 for Client to Server communications.  The original tech did not think that installing ePO would be a problem on our webserver.


20) I had intermittent problems with almost all connections to localhost / loopback interfaces under Windows 7. The issue affected not only connections to IIS 7.5 but also local proxy services, port forwarding by ssh etc. It turned out that the cause was that I had accidentally left the “Receive Window Auto-Tuning Level” setting at “experimental” after some network testing. Everything else worked normally on the computer — only loopback-related things seemed to be affected.


The current value of this setting can be displayed with the following command:
netsh interface tcp show global


To reset it to normal, issue the following command as administrator:
netsh int tcp set global autotuninglevel=normal


Otto G

12 thoughts on “Localhost connection issues list

  1. Steve Smith ran into another similar issue with a loopback ‘lockdown’:
    http://aspadvice.com/blogs/ssmith/archive/2007/02/09/SQL-Reporting-Services-401-Error.aspx

  2. Yep, skype is a pita sometimes. It can grab port 80 when starting up. Simply close Skype and start your web service, then open skype again. Happens rarely though…

  3. I had same problem – caused by IIS web site configuration. In IIS MMC clip-in left click web site properties. In ‘Web Site’ property tab – Web Site Identification – check that a specific IP address isn’t assigned. Set IP Address to (All Unassigned) – otherwise localhost wasn’t working even though I could access the web pages using the configured IP address.

  4. If Steves solution dosn´t help, then I suggest you use Microsofts IIS diagnostic tool – AuthDiag.
    Checks any IIS related problem…

    My application uses Single Sign On. Needs Anonymous disabled to work in this mode but got only “dns error” for localhost. After some headake I discovered that NTLM requires “HTTP Keep-Alive” enabled, so don´t forget to check this out on your IIS.

  5. Yes!
    Thanks a lot!!!

    After a Whole day of agony.
    Removing ::1: from hostfile did the trick!

  6. Hi !
    I have installed Apache tomcat 5.5 , while trying to access jsp page i am getiing 401 error after getting a username password msg box showin XDB login page
    Plz help !

  7. hi helpers, this is the 3rd day that i am trying to install IIS 7 on vista home premium without any success. I install iis 7 using windows features and when i look in administrativr tools, it is there installed. But when i type in browser http://localhost/ it comes error 404. And also problem comes when i try to install sql server 2005 with advanced sp2, it comes a warning that iis7 is not installed or disabled, and due to this some features will not be installed. please help me what should i do to install iis 7 properly. thanks a lot.

  8. Hi, thanks so much for this post. Skype was using port 80 and blocking my localhost. Since I’m new to this game of webserving I probably would have been struggled for many hours before I figured it out (if I were that lucky!)

  9. me helped:

    in IE7: Tools-> internet options -> connections -> lan settings -> disable check box “automatically detecting..”.

  10. Hi, I am able to access http://localhost only if I type it this way; http://localhost/wwwroot.
    This was not like this before. I am wondering what do I need to do to bypass this wwwroot and just have http://localhost to display the default IIS 7 server page.

    I am using Windows 2008 server.
    Your help is much appreciated.

    Thank you.
    Praveen.

Comments are closed.