Cannot Browse localhost

Installing, Configuring, Troubleshooting server daemons such as Web and Mail
Post Reply
jonjonz
Posts: 3
Joined: 2008/03/10 16:31:29
Contact:

Cannot Browse localhost

Post by jonjonz » 2008/05/22 20:10:19

Trying to browse the website on the server using firefox and the full site
name address, one gets a "connection refused" message. Browsing is
possible using the IP address. Other computers can browse the website
with no problems using the IP and the site name.

I have tried reordering the order of the names in the hosts file to
localhost localhost.localdomain etc. but after a restart it did not help.

I suspect that SElinux may have been activated at one time previously on
this server, and am wondering if this problem is some fallout from that, but
I don't have any idea what to look for the culpret.

Since it was serving up the site to the intended users, it was not a problem,
but I have since realized the need to be able to run some cron jobs
that use wget or curl, and have found they too get the connection
refused treatment.

Any ideas on how to resolve this?

(Typical lamp setup, apache, centos, mysql, php etc.)
8-)

Thanks,

--jonjonz

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Cannot Browse localhost

Post by gerald_clark » 2008/05/22 20:19:28

Add an entry in /etc/hosts for the IP address assigned to eth0.

jonjonz
Posts: 3
Joined: 2008/03/10 16:31:29
Contact:

Re: Cannot Browse localhost

Post by jonjonz » 2008/05/27 15:37:04

In reviewint the settings for the ethernet ports, I noticed that the fully qualified domain name
was included in the hosts file 127.0.0.1 line, and the localhost term was entered last.

The problem has resolved itself. I am not sure which action I took fixed it, however
here is what I did.

1. removed the fully qualified domain name from the 127.0.0.1 hosts entry
2. made a seperate entry in hosts for the fixed IP and the fully qualified domain name
3. changed the order of the hosts entry for 127.0.0.1 to localhost, localhost.localdomain

I read in a debian support group that the fully qualified domain name if entered in the
127.0.0.1 line of the hosts file can cause problems.

Post Reply

Return to “CentOS 4 - Server Support”