LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-01-2003, 09:31 PM   #1
Ju Deddo Koinu
Member
 
Registered: Apr 2003
Location: Austin, TX
Distribution: RedHat 9 w/ KDE
Posts: 86

Rep: Reputation: 15
apache/mozilla Connection Refused


"The Connection was refused when attempting to contact foo"

I've tried localhost and i've tried my IP. I've even added the port to the end of the url when attempting to access my apache http server from the same machine. I've tried :80 and :8080

How do I solve this problem?

RedHat9 w/ KDE
 
Old 05-01-2003, 11:00 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Is apache running? What exactly are you typing in the browser? Have you tried http://127.0.0.1 or http://localhost or http://<actual-hostname-of-machine>

Unless you changed the port in your apache httpd.conf file to listen on another port, it should be default to 80 in which you don't need to specify.

More details will get you better responses.
 
Old 05-02-2003, 05:28 AM   #3
Ju Deddo Koinu
Member
 
Registered: Apr 2003
Location: Austin, TX
Distribution: RedHat 9 w/ KDE
Posts: 86

Original Poster
Rep: Reputation: 15
as far as I know, apache is up and running, yes. I'm accessing the control panel for it through my KDE menu.

The connection is refused when attempting to access:
127.0.0.1
localhost
192.168.0.2 (the IP of the system)

I have tried (even though it doesn't really matter) with and without the http:// in front of it, and with and without the :80 and :8080 port specifier as well.

pinging each of these results in confirmed responses, so I know they are up and running, but something may be misconfigured with apache?

Also, this is the tip of the iceberg. After this, I am going to have the gateway server "serve" the pages from this box to the net in some form or fashion, but that's for another time. I can't even get this thing started *smile*
 
Old 05-02-2003, 09:34 AM   #4
GAVollink
Member
 
Registered: Apr 2002
Location: Bronx, NY
Distribution: Ubuntu
Posts: 371

Rep: Reputation: 34
% ps -ef | grep httpd

What do you get? Is it there?

% grep ^Port /etc/httpd/conf/httpd.conf

What does that say?

% telnet 192.168.0.2 80

Or replace 80 with whatever the Port statement returned above. Does this still give you a connection refused? If so - check your firewall settings. RH9 defaults to install a firewall (IPTables) setup - you may have to 'enable" port 80 there.
 
Old 05-02-2003, 03:28 PM   #5
Ju Deddo Koinu
Member
 
Registered: Apr 2003
Location: Austin, TX
Distribution: RedHat 9 w/ KDE
Posts: 86

Original Poster
Rep: Reputation: 15
code:
-----
[root@localhost root]# ps -ef | grep httpd
root 3983 3948 0 15:26 pts/1 00:00:00 grep httpd
[root@localhost root]# grep ^Port /etc/httpd/conf/httpd.conf
[root@localhost root]# telnet 192.168.0.2
Trying 192.168.0.2...
telnet: Unable to connect to remote host: Connection refused
-----
 
Old 05-02-2003, 03:30 PM   #6
Ju Deddo Koinu
Member
 
Registered: Apr 2003
Location: Austin, TX
Distribution: RedHat 9 w/ KDE
Posts: 86

Original Poster
Rep: Reputation: 15
I forgot the port designator, which came up with interesting results.

code:
-----
[root@localhost root]# telnet 192.168.0.2
Trying 192.168.0.2...
telnet: Unable to connect to remote host: Connection refused
[root@localhost root]# telnet 192.168.0.2:80
192.168.0.2:80: Unknown host
-----
 
Old 05-02-2003, 03:36 PM   #7
green_dragon37
Member
 
Registered: Oct 2002
Location: Lower Alabama
Distribution: Slackware, OpenBSD 3.9
Posts: 344

Rep: Reputation: 31
It seems that apache is not running. Verify this by typing (as root)
Code:
service httpd status
If it says "httpd is stopped," type (again, root)
Code:
service httpd start
to start it.

HTH
Ian
 
Old 05-02-2003, 03:43 PM   #8
Ju Deddo Koinu
Member
 
Registered: Apr 2003
Location: Austin, TX
Distribution: RedHat 9 w/ KDE
Posts: 86

Original Poster
Rep: Reputation: 15
Well, that was the trick... Now it works just fine (why did I overlook a step this simple? *laughs at self*) Thanks for getting that up and running for me, even though it turned out simple. Now, the command to telnet to the IP that I was suggested didn't work, but it's serving my pages just fine now.

What and where do I need to put that to have the httpd service started each time I boot? (as opposed to when I log on)

code:
-----
[root@localhost root]# service httpd status
httpd is stopped
[root@localhost root]# service httpd start
Starting httpd: [ OK ]
[root@localhost root]# telnet 192.168.0.2
Trying 192.168.0.2...
telnet: Unable to connect to remote host: Connection refused
[root@localhost root]# telnet 192.168.0.2:80
192.168.0.2:80: Unknown host
-----
 
Old 05-02-2003, 03:46 PM   #9
green_dragon37
Member
 
Registered: Oct 2002
Location: Lower Alabama
Distribution: Slackware, OpenBSD 3.9
Posts: 344

Rep: Reputation: 31
Code:
chkconfig --level=345 httpd on
should do the trick

Ian
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache -> connection refused error dimlight Linux - Networking 6 08-11-2010 01:56 PM
Connection Refused Using Apache G24 Linux - Networking 14 09-24-2005 11:31 AM
Apache connection refused tarnishedXhalo Red Hat 2 05-19-2004 12:51 AM
apache/ftp connection refused??? Devboy Linux - Software 2 10-22-2003 03:33 AM
apache connection refused ariana Linux - Newbie 2 02-28-2003 11:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:11 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration