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?

womble
  • 95,029
  • 29
  • 173
  • 228

5 Answers5

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.

Dave Cheney
  • 18,307
  • 7
  • 48
  • 56
  • 1
    I'd be quite surprised if one of those two wasn't the cause of the problem. – womble Jun 27 '09 at 07:51
  • no i donot connect thro proxy. so the proxy miss/hit and rest of the scenario does not come into consideration. –  Jun 27 '09 at 08:16
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

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
Christian
  • 779
  • 1
  • 13
  • 31
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)

Amandasaurus
  • 30,211
  • 62
  • 184
  • 246
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.

Peter Mortensen
  • 2,319
  • 5
  • 23
  • 24