0x01 安装apache
1、安装apache
yum install -y httpd
2、修改配置文件
配置ServerName,进入httpd.conf文件:
vim /etc/httpd/conf/httpd.conf
apache默认就是使用80端口
![](https://i-blog.csdnimg.cn/blog_migrate/e56db66e841db8399dc3d67c48b2a3d2.png)
3、防火墙开放80端口
开启防火墙
systemctl start firewalld
查看防火墙状态
systemctl status firewalld
![](https://i-blog.csdnimg.cn/blog_migrate/c53f64be45638c15166e59873a2f04cb.png)
看到绿色的 active(running)代表防火墙开启成功
设置防火墙开机自启
systemctl enable firewalld
添加80端口
firewall-cmd --permanent--zone=public --add-port=80/tcp
使防火墙配置生效
firewall-cmd --reload
查看开放端口列表
firewall-cmd --permanent--zone=public --list-ports