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. |
service iptables status
|
Code:
[root@intranet ~]# service iptables status |
service iptables stop
and see if you can connect to your server |
iptables -L
is the policy ACCEPT ? if not your firewall settings on the server may be blocking port 80.. |
Also, you might want to try: netstat -al to make sure port 80 is in LISTEN mode.
|
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 |
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 Any ideas about the iptables rule? Thanks for the help. |
All times are GMT -5. The time now is 10:09 AM. |