https://coderschool.cn/2389.htmlhtml
https://coderschool.cn/2389.htmlcentos
解決辦法
防火牆開啓 80 和 443 端口。由於 vps 使用的是 centos 7 ,下面介紹 centos7 下防火牆開啓 80 和 443 端口的方法:tcp
1centos7 2spa 3.net |
啓動防火牆 rest [root@dfdf ~]# systemctl start firewalld.service code |
1htm 2blog 3 4 5 6 7 8 9 |
開啓 80 443 端口 [root@dfdf ~]# firewall-cmd --zone=public --add-port=80/tcp --permanent success [root@dfdf ~]# firewall-cmd --zone=public --add-port=443/tcp --permanent success |
1 2 3 |
重啓防火牆 [root@dfdf ~]# firewall-cmd --reload |
操做截圖:
![centos7下防火牆開啓80和443端口](http://static.javashuo.com/static/loading.gif)
參數介紹
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
開啓端口: firewall-cmd --zone=public --add-port=80/tcp --permanent 命令含義: --zone #做用域 --add-port=80/tcp #添加端口,格式爲:端口/通信協議 --permanent #表明永久生效,沒有此參數重啓後失效 重啓防火牆: firewall-cmd --reload 或者service firewalld restart |