Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a Vista laptop that I have been running Apache / MySql / Php / PhpMyAdmin on for quite some time without fail. I just use it to test bits of code here and there etc. No problems, until recently when I needed to test something and I happened to be in a place that I could not get an internet connection. Why am I unable to access localhost from the same machine without an internet connection? I am type http://localhost..etc into the browser's address bar and I get the message that I am unable to access without an internet connection. I checked my windows/system32/etc/hosts file and the first two lines are localhost

::1 localhost

What am I missing here?

share|improve this question

migrated from Oct 9 '09 at 0:19

This question came from our site for professional and enthusiast programmers.

Is the server up? Have you checked? – Vinko Vrsalovic Oct 8 '09 at 16:25
Do you mean http://localhost/etc? (/, not ..) – SLaks Oct 8 '09 at 16:25
Why do you have localhost in your hosts file twice? There should only be one entry that is localhost – James Goodwin Oct 8 '09 at 16:29
@James Goodwin - "::1 localhost" is for IPv6 – Mark Oct 8 '09 at 16:37
Do you use localhost when you have internet plugged in, or just when you are not connected? If so, then the problem most likely is a wrongly configured NameVirtualHost directive. – Raynet Oct 9 '09 at 0:35

4 Answers 4

Do you need to stick a loopback Ethernet plug into your ethernet port?

share|improve this answer
This is not required to access localhost from a web browser. – Ken White Oct 8 '09 at 16:30

I think it's just a problem with the browser. If you are on Firefox and there is no internet connection it will put you into "offline mode". Check this by going to File > Work Offline

share|improve this answer
It happens with both Mozilla and IE... Oh and Opera too. – robert knobulous Oct 8 '09 at 16:28
this seems most likely to me, assuming the OP's URL is misreported :) – quack quixote Nov 27 '09 at 20:58
The tcp/ip stack with loopback is started along with the configured network connection in many versions of windows. – tovare Sep 6 '10 at 20:26

This means that the Apache server is not running or you have the port configured to a different port on your machine.

Another potential issue is that the host name of apache may be different than or localhost.

share|improve this answer

I had this issue once on an older version of windows, where I needed to dial up to make the loopback ( work.

You should be able to install a loopback adapter (software driver as described in the article above), but you might consider get a router and make your own little development network instead.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.