Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

127.0.0.1 localhost 
127.0.1.1 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

5 Answers 5

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).

127.0.0.1 localhost
127.0.1.1 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 http://stackoverflow.com/questions/2204951/fedora-chrome-cant-access-localhost-or-127-0-0-1-when-offline 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

 
discard

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