0

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?

5 Answers 5

3

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.

2
  • 1
    I'd be quite surprised if one of those two wasn't the cause of the problem.
    – womble
    Jun 27, 2009 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, 2009 at 8:16
0

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
0

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)

0

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

0

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.

You must log in to answer this question.