Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a newly installed CentOS 5.6 machine and can access httpd locally via elinks. But it does not work from other IPs. I can ping the IP, but I get no route to host if I connect to port 80. I assume some firewall rules is preventing access to Port 80 and have check iptables and it seems fine.

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

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

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain RH-Firewall-1-INPUT (2 references)
target     prot opt source               destination
ACCEPT     all  --  
ACCEPT     icmp --             icmp type 255
ACCEPT     esp  --  
ACCEPT     ah   --  
ACCEPT     udp  --           udp dpt:5353
ACCEPT     udp  --             udp dpt:631
ACCEPT     tcp  --             tcp dpt:631
ACCEPT     all  --             state RELATED,ESTABLISHED
ACCEPT     tcp  --             state NEW tcp dpt:22
REJECT     all  --             reject-with icmp-host-prohibited
share|improve this question
Please post your /etc/sysconfig/iptables file. – Andrew Case Nov 8 '11 at 22:02

You don't appear to have a rule to allow traffic on port 80 try this

/sbin/iptables -I RH-Firewall-1-INPUT -p tcp -m tcp --dport 80 -j ACCEPT

if that works then save you firewall configuration with

/sbin/service iptables save 

Another thing to check is that Apache is actually configured to listen on your external IP address. Check the Listen directive in your /etc/httpd/conf/httpd.conf file. It should be something like

Listen 80 

to listen on all available addresses.

share|improve this answer

If SELinux enabled - first of all check all the apache related SELinux boolean values:

[root@localhost ~]# getsebool -a | grep httpd
       . . . . . . 
httpd_builtin_scripting --> on
httpd_can_network_connect --> off
httpd_can_network_connect_db --> off
httpd_can_network_relay --> off
httpd_disable_trans --> off
httpd_enable_cgi --> on
httpd_enable_ftp_server --> off
httpd_enable_homedirs --> on
     . . . . . . . .

if httpd_can_network_connect --> off disable SELinux restriction on httpd:

[root@localhost ~]# setsebool -P httpd_can_network_connect on

Or use system-config-selinux, also known as the SELinux Administration graphical tool, to control the Boolean values of specific daemons.

share|improve this answer
He can test if it's a SELinux issue by temporarily putting it into permissive mode. setenforce Permissive; [run tests]; setenforce Enforcing – Andrew Case Nov 8 '11 at 22:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.