阅读量:245
今天配置一台Linux服务器,系统是Centos,配置完毕访问网站时却不成功,没有什么提示,就是网络不通,访问网页超时。访问网页超时不过,我在服务器里用wget命令访问网站时,却是成功的。wget命令访问网站成功也即是说,外网访问不了网站,服务器里能访问。这是什么原因呢?后来我问了下客服,他叫我关了防火墙试试,关闭防火墙的命令是:iptables stop。我没有这样操作,而是清空iptables规则,使用命令是:iptables -F && iptables -X && iptables -Z。我之前更改过config安全配置文件,位置在:/etc/selinux/config,使用代码是:
This file controls the state of SELinux on the system.
# SELINUX can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
# SELINUX=enforcing
SELINUX=disabled
# SELINUXTYPE can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
更改完毕,再访问网站,真的成功了!原来真是防火墙的问题!