LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Apache 2 - port 80 closed (https://www.linuxquestions.org/questions/linux-newbie-8/apache-2-port-80-closed-605194/)

intramaweb 12-07-2007 10:06 AM

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.

dyasny 12-07-2007 10:07 AM

service iptables status

intramaweb 12-07-2007 10:15 AM

Code:

[root@intranet ~]# service iptables status
Table: filter


dyasny 12-07-2007 10:23 AM

service iptables stop

and see if you can connect to your server

farslayer 12-07-2007 10:24 AM

iptables -L

is the policy ACCEPT ? if not your firewall settings on the server may be blocking port 80..

mikebudohiee 12-07-2007 04:52 PM

Also, you might want to try: netstat -al to make sure port 80 is in LISTEN mode.

farslayer 12-07-2007 08:02 PM

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


intramaweb 12-11-2007 07:05 AM

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.


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