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

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

保存退出即可

猜你喜欢

转载自hongmin118.iteye.com/blog/1871765