LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 07-09-2005, 02:54 PM   #1
rtcary
Member
 
Registered: Dec 2004
Location: Petaluma, CA
Distribution: Centos 4 and RH 9
Posts: 47

Rep: Reputation: 15
FC3; Localhost=Connection refused


Just installed FC3 and the network is up as well as smb. I can access the Internet as well as use Samba and the network printer.

I am overlooking something simple since "localhost" connection is
refused e.g. http://localhost in the browser.

I tried disabling security using the GUI interface, and the connection is still refused.

The fist line of the hosts file reads

127.0.0.1 localhost.localdomain localhost

Any suggestions as what I should be checking?

Here are the results of netstat and ifconfig:

eth0 Link encap:Ethernet HWaddr 00:10:4B:74:F3:99
inet addr:192.168.0.12 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::210:4bff:fe74:f399/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:404 errors:0 dropped:0 overruns:0 frame:0
TX packets:417 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:48604 (47.4 KiB) TX bytes:39706 (38.7 KiB)
Interrupt:11 Base address:0xec00

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1977 errors:0 dropped:0 overruns:0 frame:0
TX packets:1977 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2332669 (2.2 MiB) TX bytes:2332669 (2.2 MiB)


Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
 
Old 07-09-2005, 03:36 PM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
Is apache even running? It has to be running in order to view http requests in a browser for your localhost
 
Old 07-09-2005, 09:41 PM   #3
rtcary
Member
 
Registered: Dec 2004
Location: Petaluma, CA
Distribution: Centos 4 and RH 9
Posts: 47

Original Poster
Rep: Reputation: 15
Yup...browse the Internet and communicate with Windows box via Samba.
 
Old 07-10-2005, 12:43 AM   #4
mvan83
LQ Newbie
 
Registered: Jun 2005
Distribution: Fedora
Posts: 19

Rep: Reputation: 0
Quote:
Originally posted by rtcary
Yup...browse the Internet and communicate with Windows box via Samba.
That doesn't mean Apache is running. The internet working has nothing to do with Apache. Make sure that Apache is running and try it again. If that doesn't work, try http://localhost:8080
It probably won't make a difference, but it's worth a try.
 
Old 07-10-2005, 03:26 AM   #5
Michael Johnson
Member
 
Registered: Jul 2005
Location: Wagga Wagga, Australia
Posts: 262

Rep: Reputation: 30
try this command
#ps -ax | grep httpd
if you get no information the chances are apache is NOT running. If it prints out info. then it is running.
 
Old 07-10-2005, 07:51 AM   #6
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
Quote:
Originally posted by rtcary
Yup...browse the Internet and communicate with Windows box via Samba.
Sorry but I had to say that your reply made me smile..

Apache is not the internet, it is though a webserver that has to be running in order to view your own documents shared out thru a web browser..
 
Old 07-10-2005, 09:15 AM   #7
rtcary
Member
 
Registered: Dec 2004
Location: Petaluma, CA
Distribution: Centos 4 and RH 9
Posts: 47

Original Poster
Rep: Reputation: 15
Yup...I did make a leap there! There are 9 httpd processes running.

Shouldn't 127.0.0.0 be listed in the routing table?

Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
 
Old 07-10-2005, 09:20 AM   #8
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
Quote:
Originally posted by rtcary
Yup...I did make a leap there! There are 9 httpd processes running.

Shouldn't 127.0.0.0 be listed in the routing table?

Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
It's 127.0.0.1 and it shouldn't be listed in the routing table unless it's acting as a router or gateway.
 
Old 07-10-2005, 09:39 AM   #9
rtcary
Member
 
Registered: Dec 2004
Location: Petaluma, CA
Distribution: Centos 4 and RH 9
Posts: 47

Original Poster
Rep: Reputation: 15
The reason I asked is because on another box running RH 9 I get this from netstat -nr:

Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
 
Old 07-10-2005, 06:35 PM   #10
rtcary
Member
 
Registered: Dec 2004
Location: Petaluma, CA
Distribution: Centos 4 and RH 9
Posts: 47

Original Poster
Rep: Reputation: 15
In "man route" it says "route add -net 127.0.0.0" should add the route to the table; however I get an error:

SIOCADDRT: Invalid argument

Any suggestions?
 
Old 07-10-2005, 10:20 PM   #11
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
Quote:
Originally posted by rtcary
In "man route" it says "route add -net 127.0.0.0" should add the route to the table; however I get an error:

SIOCADDRT: Invalid argument

Any suggestions?
Okay so stop worrying about this route, it has nothing to do with your problem if you want to access apache via localhost in your browser..
 
Old 07-10-2005, 10:26 PM   #12
Michael Johnson
Member
 
Registered: Jul 2005
Location: Wagga Wagga, Australia
Posts: 262

Rep: Reputation: 30
Your network is all up running as it should be. So lets get down to the web server and stop all this talk about routes and network setups. Please tell us what you get you do the following command.
#ps -ax | grep httpd
We need to know this to help you.
 
Old 07-10-2005, 10:42 PM   #13
rtcary
Member
 
Registered: Dec 2004
Location: Petaluma, CA
Distribution: Centos 4 and RH 9
Posts: 47

Original Poster
Rep: Reputation: 15
Here are the results of ps -ax | grep httpd:

7911 ? Ss 0:00 /usr/sbin/httpd
7914 ? S 0:00 /usr/sbin/httpd
7915 ? S 0:00 /usr/sbin/httpd
7916 ? S 0:00 /usr/sbin/httpd
7917 ? S 0:00 /usr/sbin/httpd
7918 ? S 0:00 /usr/sbin/httpd
7919 ? S 0:00 /usr/sbin/httpd
7920 ? S 0:00 /usr/sbin/httpd
7921 ? S 0:00 /usr/sbin/httpd
 
Old 07-10-2005, 10:52 PM   #14
rtcary
Member
 
Registered: Dec 2004
Location: Petaluma, CA
Distribution: Centos 4 and RH 9
Posts: 47

Original Poster
Rep: Reputation: 15
Here are the results of iptables -L:

Chain INPUT (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- anywhere anywhere

Chain FORWARD (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain RH-Firewall-1-INPUT (2 references)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT icmp -- anywhere anywhere icmp any
ACCEPT ipv6-crypt-- anywhere anywhere
ACCEPT ipv6-auth-- anywhere anywhere
ACCEPT udp -- anywhere 224.0.0.251 udp dpt:5353
ACCEPT udp -- anywhere anywhere udp dpt:ipp
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:https
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ftp
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
 
Old 07-10-2005, 10:56 PM   #15
Michael Johnson
Member
 
Registered: Jul 2005
Location: Wagga Wagga, Australia
Posts: 262

Rep: Reputation: 30
Your web server is running. The next step is to examine the apache configuration and check for "hosts allow" and "hosts deny". Do general scan through all of this file and see if you can spot anything that may be blocking your access. Another thing to try is do
#/sbin/ifconfig
This will give the IP address of the ethernet port "eth0". Use this IP address and see if you get a page. You must have a Document root set and you will need to have a default page in it. This is usually done at apache setup. But check this anyway. The usual location is "/var/www/html". I don't much about Apache server but I'm sure you will find the problem in the configuration file.

edit
Just saw your iptables come up. To prove its not iptables then stop that daemon.

Last edited by Michael Johnson; 07-10-2005 at 10:59 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
telnet localhost: Connection refused? neocookie Linux - Networking 10 08-16-2005 03:15 PM
Connection to localhost refused?!? a_priebe47 Slackware 4 09-01-2004 09:05 PM
connection to localhost refused digitalgravy Linux - Networking 5 05-03-2004 04:27 PM
rsh localhost : connection refused StressedLemming Linux - Networking 1 11-09-2003 12:20 PM
ftpd connection refused from localhost Caidence Linux - Networking 2 11-06-2003 04:13 AM


All times are GMT -5. The time now is 10:49 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration