CentOS 7 默認沒有使用iptables,所以通過編輯iptables的配置文件來開啟80端口是不可以的
CentOS 7 采用了 firewalld 防火牆
如要查詢是否開啟80端口則:
1
2
|
[root@joe-pc ~]
# firewall-cmd --query-port=80/tcp
no
|
顯然80端口沒有開啟
下面我們開啟80端口:
1
2
|
[root@joe-pc ~]
# firewall-cmd --add-port=80/tcp
success
|