操作命令:
1、?yum install httpd.x86_64 httpd-manual -y?? 安装服务
2、?systemctl start httpd 启动服务
3、?systemctl enable httpd.service?????? 开机自启
---将服务加入防火墙策略
4、?firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
? firewall-cmd --reload
5、?systemctl restart httpd.service 重启服务,使设置生效
// 如找不到防火墙设置命令,执行以下命令进行下载安装
安装服务: yum install firewalld
启动: systemctl start firewalld
关闭: systemctl stop firewalld
查看状态: systemctl status firewalld
开机禁用 : systemctl disable firewalld
开机启用 : systemctl enable firewalld
查看开放的端口:firewall-cmd --list-ports
// (–permanent永久生效,没有此参数重启后失效)
添加端口:firewall-cmd --add-port=8080/tcp --permanent
|