Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have not tested on windows. but in ubuntu when you disconnect from the network, start Apache, and enter localhost in any browser, it does not show the page it is supposed to show. localhost vksTP 
# this is how the /etc/hosts looks for IPv4

One solution, is to use the browser in offline mode. but that is not a proper solution I think. Do i change something in resolv.conf or /etc/hosts?

share|improve this question

Is you apache configured to listen on *:80, or specifically on the IP address bound to eth0 ? Check /etc/httpd/conf/httpd.conf

Is your browser configured to use a proxy ? If you are not connected to the network then your browser will be unable to connect to the proxy, even to retrieve data from your local machine. You can probably work around this by putting the hostname of you machine, and localhost into the exclusion list for your proxy configuration.

share|improve this answer
I'd be quite surprised if one of those two wasn't the cause of the problem. – womble Jun 27 '09 at 7:51
no i donot connect thro proxy. so the proxy miss/hit and rest of the scenario does not come into consideration. – Vivek Sharma Jun 27 '09 at 8:16

Can you browse directly to the IP addresses without a connection? If so, put the lines you wrote above into the hosts file (/etc/hosts on ubuntu or c:\Windows\System32\drivers\etc\hosts on win). localhost vksTP
share|improve this answer

I have had the problem before. WHen you disconnect NetworkManager tells Firefox that there is no network, and Firefox goes into offline mode. Then you can't get online. Try switching Firefox to Online Mode (File -> Work Offline)

share|improve this answer

Google Chrome and Chromium switch automatically to offline or online mode. A bug causes it not to access localhost when there is no network connection.

See for solution.

share|improve this answer

I had the same problem. In Ubuntu 9.04 I just removed the tick next to "File - Work Offline" and now it's working without the network plugged in.

share|improve this answer

Your Answer


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