解决 Linux 安装 httpd局域网无法访问

来源:互联网 发布:居则曰 不吾知也翻译 编辑:程序博客网 时间:2024/06/05 02:12

 

yum install httpd

 

局域网无法访问,但本机是好的。

 

vim /etc/httpd/conf/httpd.conf

Allow from all 也是正常的。

 

折腾了1个小时,原来是防火墙关了。

vim /etc/sysconfig/iptables

 

添加

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

 

重启防火墙

service iptables restart

当然,也可以这样重启:

/etc/rc.d/init.d/iptables restart

 

保存退出即可