httpd已经安装,但是/var/www/html网页打不开

来源:互联网 发布:网络授权书 编辑:程序博客网 时间:2024/06/05 11:38

今天遭遇httpd已经安装,但是/var/www/html网页打不开这个情况,网上有很多解决方案,包括关闭防火墙、selinux、或者是在httpd.conf上加ServerName localhost什么的,然而没有一个有用的,恩,这个情况仅仅是针对我不是针对你,或许这个方法对你有用,我会把具体方法给你们,你们可以一一尝试:

1. chkconfig iptables off

2.临时关闭selinuxsetenforce 0,

永久关闭selinux

vi /etc/sysconfig/selinux

把里边的一行改为

SELINUX=disabled

改了之后保存,然后重启就可以了。

3./etc/httpd/conf/httpd.conf添加 ServerName localhost

-----------------------------------------------------------------华丽的分割线------------------------------------------------------------

上面方法我都试了,并没有用,然后我就发现了这个方法

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 ,再打开网页,显示正常

OK,执行一下把,问题解决了

阅读全文
0 0