centos7已经开始使用firewall作为防火墙,而不是iptables了,所以,开放8080端口就和以往不一样了,下面为centos7下开发8080端口步骤
- 输入命令
firewall-cmd --state
查看防火墙的状态.
如果上一步处于关闭状态,输入命令 systemctl start firewalld.service
开启防火墙.
- 输入命令
firewall-cmd --zone=public --add-port=8080/tcp --permanent
开启8080端口.

3.输入命令systemctl restart firewalld.service
重启防火墙.

4.输入命令firewall-cmd --reload
重新载入配置.

作者:城堡下的晚祷
链接:https://www.jianshu.com/p/88b6463abc9c
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。