今天在Linux系统上部署项目的时候发现一个问题,服务启动没有报错,但是就是访问不到。之后发现是Linux系统的防火墙没有关闭。用“CentOS7”将防火墙关闭后服务就可以正常访问了;
CentOS7查看和关闭防火墙
CentOS 7.0默认使用的是firewall作为防火墙
查看防火墙状态:firewall-cmd --state
停止firewall:systemctl stop firewalld.service
禁止firewall开机启动:systemctl disable firewalld.service
CentOS6查看和关闭防火墙
关闭防火墙:service iptables stop
启动防火墙:service iptables start
重启防火墙:service iptables restart
查看防火墙状态:service iptables status
永久关闭防火墙:chkconfig iptables off