Localhost doesn't work

Hello All,

I have a problem that I just can't figure out. First off I have a G5 running 10.4.10 Server with Apache 1.3 hosting a internal web site, doing some php and MySql stuff in the background. It all works fine as is, and has been for over a year now.

For whatever reason (I can't remember why I tried) I tried to connect to the the site using http://localhost. I get a message saying "Firefox can't establish a connection to the server at localhost". I have the site located at /Library/WebServer/Documents, with a index.html file inside Documents.

I get the same message using Safari as well. But here is the real weird thing, IE 5.2 will work just fine!! Firefox and Safari will work if I put in the IP of the server in the address bar, just not localhost or 127.0.0.1.

Here is what I have checked or done so far. Turned off proxy settings, put localhost in the "Bypass Proxy" settings, checked the /etc/hosts file and it contains:

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost



The networks file looks like this:

##
# Networks Database
##
loopback 127 loopback-net


I also looked through the httpd.conf file for anything that looked like it might be misconfigured, but didn't see anything there either.

I'm puzzled about why it doesn't work. Any help on this would be greatly appreciated.

Thanks
John

G5, 17" Mac Book Pro, Mac OS X (10.4.10)

Posted on Sep 27, 2007 3:33 PM

Reply
8 replies

Sep 27, 2007 4:28 PM in response to sandpilot

If netstat -an | egrep 80 shows a listener on all interfaces including the loopback, the only server possibility I can think of is the performance cache is goofing things up. Otherwise, I'd just draw my conlusions about the browsers.

Roger

Sep 27, 2007 4:53 PM in response to sandpilot

Roger,

Here is what the netstat command returned. I'm not sure what I'm looking for here. Can you shed some light.

dfrcas25:~ admin$ netstat -an | egrep 80
tcp4 0 0 130.134.64.22.80 . LISTEN
tcp4 0 0 *.8088 . LISTEN
3a782a8 stream 0 0 0 3a78880 0 0
3a78880 stream 0 0 0 3a782a8 0 0
3a78088 stream 0 0 44c3bdc 0 0 0 /private/var/run/cupsd
3831880 stream 0 0 0 3831908 0 0 /var/run/mDNSResponder
3831908 stream 0 0 0 3831880 0 0
36f9880 stream 0 0 36df084 0 0 0 private/lmtp
3664880 stream 0 0 36df5ac 0 0 0 private/trace
330a550 stream 80 0 0 330a7f8 0 0
36fc908 dgram 0 0 0 330a3b8 0 36fc880
36fc880 dgram 0 0 0 330a3b8 0 36fc7f8
330a5d8 dgram 0 0 0 330a3b8 0 330a880
330a880 dgram 0 0 0 330a3b8 0 330acc0

Also, I checked and Performance Cache is turned off.

Thanks for the response. I will be out of town until, Monday if you need further info, I can get it then.

Thanks
John

Sep 27, 2007 4:56 PM in response to sandpilot

The money line is:

tcp4 0 0 130.134.64.22.80 . LISTEN

Your webserver is listening on the 130 interface, but not on the loopback. Explorer's not behaving properly, imagnine that!

Roger

Sep 27, 2007 9:38 PM in response to myriapod

Well I couldn't just leave without checking from home tonight. Here are the responses to your responses.

The money line is:

tcp4 0 0 130.134.64.22.80 . LISTEN

Your webserver is listening on the 130 interface, but not on the loopback. Explorer's not behaving properly, imagnine that!


OK, I admit, I'm a greenhorn at this. Is there a way to make it listen on localhost or 127.0.0.1 or whatever I need to do?


Second Question--------


hi,
your problem maybe starts from an installed or misconfigured setup of a module for Apache...
what you paste above seems to me that something is running and listening on port 8088, usually is a Apache-Coyote module for Catalina.


We have the Enterprise edition of Symantec Anti-Virus for Mac. (Government mandate) I have SAV update server running on port 8088 for all of our Macs, that is what Symantec wanted. Not my choice.

So does that shed some light on things? If so, how do I go about fixing it?

I will try to check back while I'm on the road, if possible.

Thanks guys.
John

Sep 28, 2007 4:43 PM in response to sandpilot

I'm not familiar with OSX's GUI for the webserver. It frustrates me every time I try to use it, so I edit the files by hand. In terminal:

cd /etc/httpd
sudo egrep -r 'Listen|VirtualHost' *

You'll see (probably) that one or both have your IP address. If that was changed to * then Apache will listen on ALL interfaces including lo0 (127.0.0.1). Exactly where in the GUI that's done, I don't know, but if that change is made and Apache restarted, you should be all set.

Roger

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Localhost doesn't work

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.