端口讲解:
防火墙开启,开机启动,状态,停止,开机关闭
systemctl [start | enable | status | stop | disable] firewalld.service
查看防火墙状态:
firewall-cmd --state
开80端口命令:
firewall-cmd --zone=public --add-port=80/tcp --permanent
注释:
--zone #作用域
--add-port=80/tcp #添加端口,格式为:端口/通讯协议
--permanent #永久生效
重新载入:
firewall-cmd --reload
查看开启的端口:
firewall-cmd --list-ports
centos7.X下安装
1.首先使用xshell工具以root用户连接服务器
2.输入以下安装命令会进行自动安装
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install.sh && sh install.sh
3.安装完成后会出现以下界面
Bt-Panel-URL: http://*.*.*.*:8888
username: **********
password: **********
Warning:
If you cannot access the panel,
release the following port (8888|888|80|443|20|21) in the security group
4.浏览器输入 http://xx.xx.xx.xx:8888 输入用户名和密码登录.
本地虚机搭建的宝塔:http://xxx.xxx.xxx.xxx:8888/xxxxxxxx
阿里云搭建的宝塔:http://xxx.xxx.xxx.xxx:8888
本地虚机搭建的宝塔,IP地址不是提示的IP,而是自己虚机配置的IP地址
阿里云搭建的宝塔,直接用提示的IP地址即可(阿里云的需要在"安全组规则"中添加端口)

本文详细介绍了在CentOS系统中如何通过firewalld服务管理防火墙,包括开启、关闭、查看状态及添加端口等操作。同时,提供了在宝塔面板上配置特定端口的方法,确保服务器安全并使面板可正常访问。
9343

被折叠的 条评论
为什么被折叠?



