背景:笔者CentOS 版本为6.8,当在centos服务器上部署好网站程序后,使用wget本地访问出现以下错误
# 执行wget命令
wget http://127.0.0.1:8600
# 报错
Connecting to 127.0.0.1:8600... failed: No route to host
解决办法:在本地防火墙配置需允许此端口访问,设置如下:
# 编辑iptables配置文件
vim /etc/sysconfig/iptables
# 增加以下配置,开放本地8600端口,然后保存
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:8600
# 重启防火墙
service iptables restart