linux iptables导致httpd网页打不开

解决网页无法访问问题
本文记录了一次解决网页无法访问的问题经历。通过查看httpd的日志文件发现与suexec相关的信息,进一步检查iptables规则后发现80端口被拦截。在清除iptables规则后,网页恢复正常访问。

  问题:httpd 服务已启动,80端口已开,但是网页就是打不开,重启服务器还是不行

忽然想看看log,记录如下:

   [Fri Jul 15 00:41:03 2011] [notice] SELinux policy enabled; httpd running as context root:system_r:httpd_t:s0

   [Fri Jul 15 00:41:03 2011] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)

   [Fri Jul 15 00:41:03 2011] [notice] Digest: generating secret for digest authentication ...

   [Fri Jul 15 00:41:03 2011] [notice] Digest: done

   [Fri Jul 15 00:41:03 2011] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations

  看到 suexec,明白了,果断iptables -L ,结果如下:

   ACCEPT     all  --  anywhere             anywhere            

ACCEPT     icmp --  anywhere             anywhere            icmp any 

ACCEPT     esp  --  anywhere             anywhere            

ACCEPT     ah   --  anywhere             anywhere            

ACCEPT     udp  --  anywhere             224.0.0.251         udp dpt:mdns 

ACCEPT     udp  --  anywhere             anywhere            udp dpt:ipp 

ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ipp 

ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED 

ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh 

REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited 

 

     全部干掉,iptables -F ,再打开网页,显示正常





本文转自 taojin1240 51CTO博客,原文链接:http://blog.51cto.com/taotao1240/611758,如需转载请自行联系原作者
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值