CentOS 5.2 安装httpd,Apache服务器后无法访问解决方法

很大的原因是防火墙:

通过/etc/init.d/iptables status命令查询是否有打开80端口,如果没有可通过两种方式处理:

1.修改vi /etc/sysconfig/iptables命令添加使防火墙开放80端口

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

2.关闭防火墙

/etc/init.d/iptables stop

#start 开启

#restart 重启

永久性关闭防火墙chkconfig --level 35 iptables off