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

今天遭遇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,执行一下把,问题解决了

  • 3
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 7
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值