操作系统防火墙:
1. 查看防火墙状态
使用 iptables:
sudo iptables -L
使用 firewalld:
sudo firewall-cmd --list-all
2. 关闭防火墙
使用 iptables:
sudo service iptables stop
或者
sudo systemctl stop iptables
使用 firewalld:
sudo systemctl stop firewalld
3. 禁止防火墙开机自启
使用 iptables:
sudo chkconfig iptables off
使用 firewalld:
sudo systemctl disable firewalld
ECS实例的公网IP和内网IP
如果你是通过公网访问ECS实例,确保ECS实例已经分配了公网IP,并且公网IP处于激活状态。同时,检查ECS实例的内网IP,确保你的应用程序监听的 IP 地址是正确的。
网络安全组设置
由于用的阿里云ECS,需要将端口暴露出来
如果是mysql就是3306 nginx就是80
注:配置完安全组需要重启下服务器
如果这些都没有错,可以看下电脑里的梯子关闭了没,会影响到端口的访问。