LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 12-07-2007, 10:06 AM   #1
intramaweb
LQ Newbie
 
Registered: May 2006
Location: Coventry, UK
Distribution: CentOS 5
Posts: 15

Rep: Reputation: 0
Apache 2 - port 80 closed


I've installed CentOS 5 with Apache2, PHP and MySQL but the web server isn't working. I can ping the machine but no website because according to nmap, port 80 is closed.

httpd is running
Port 80 is set in the Listen, ServerName and NameVirtualHost directives of httpd.conf

Any ideas? Cheers.
 
Old 12-07-2007, 10:07 AM   #2
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 832

Rep: Reputation: 91
service iptables status
 
Old 12-07-2007, 10:15 AM   #3
intramaweb
LQ Newbie
 
Registered: May 2006
Location: Coventry, UK
Distribution: CentOS 5
Posts: 15

Original Poster
Rep: Reputation: 0
Code:
[root@intranet ~]# service iptables status
Table: filter
 
Old 12-07-2007, 10:23 AM   #4
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 832

Rep: Reputation: 91
service iptables stop

and see if you can connect to your server
 
Old 12-07-2007, 10:24 AM   #5
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,231
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
iptables -L

is the policy ACCEPT ? if not your firewall settings on the server may be blocking port 80..
 
Old 12-07-2007, 04:52 PM   #6
mikebudohiee
LQ Newbie
 
Registered: Feb 2006
Location: Florida
Distribution: SuSE, Debian, PCLINUX2007
Posts: 13

Rep: Reputation: 0
Also, you might want to try: netstat -al to make sure port 80 is in LISTEN mode.
 
Old 12-07-2007, 08:02 PM   #7
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,231
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
Actually I would use netstat -alnp | grep ::80 so I could see what process is listening on port 80..

definately a good thought

Code:
debianetch:~# netstat -alnp | grep ::80
tcp6       0      0 :::80                   :::*                    LISTEN     1446/apache2
 
Old 12-11-2007, 07:05 AM   #8
intramaweb
LQ Newbie
 
Registered: May 2006
Location: Coventry, UK
Distribution: CentOS 5
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks for the tips guys. Netstat reports that httpd is listening to port 80. It seems the problem was iptables as stoping the service as advised allowed me to reach the Apache test page successfully.

Two problems however:
1) I tried adding this rule to accept incoming connections on port 80 with iptables turned on, but it doesn't seem to be working:
Code:
iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
2) I've configured name based virtual hosts in Apache but these aren't working and I'm only getting the test page. This is a separate problem so I'll repost.

Any ideas about the iptables rule? Thanks for the help.

Last edited by intramaweb; 12-11-2007 at 07:06 AM.
 
  


Reply

Tags
apache, apache2, port


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Port closed down Hampster Linux - Security 12 07-03-2006 01:29 PM
Port Scan: Closed Port instead of Stealth unihiekka Linux - Security 9 12-26-2005 08:51 PM
apache and micticaly closed port gosha Linux - Security 3 07-17-2003 04:22 AM
apache and micticaly closed port gosha Linux - Networking 2 07-17-2003 04:03 AM
firewall.rc.config says :"open port 8080" but nmap says port is closed saavik Linux - Security 2 02-14-2002 12:16 PM


All times are GMT -5. The time now is 04:09 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