-
-
辰哥 管理员
发表于2018-11-12 09:05
楼主
CentOS6下日志显示正常启动,应用却提示无法访问,2种方案轻松帮你解决。
在CentOS6下部署应用,查看日志发现应用正常启动,但访问应用时却提示无法访问。
这种情况一般是由于系统防火墙阻止了对端口的访问,所以需要关闭防火墙。
解决方案有两种,一种简单除暴,直接将防火墙禁用,这种处理简单高效,当有多个端口被限制访问时最有效;一种是开放个别端口,以方便应用正常使用。
用root用户执行下列命令:
service iptables stop

我们还要关闭自动启动,避免重启之后又启动了防火墙:
chkconfig iptables off

2. 开放防火墙访问端口
用root用户执行下列命令。假设应用的访问端口是8080:
开放端口:
/sbin/iptables -I INPUT -p tcp --dport8080-j ACCEPT

保存配置:
/etc/init.d/service iptables save

重启防火墙:
service iptables restart
