0x01 安装apache
1、安装apache
yum install -y httpd
2、修改配置文件
配置ServerName,进入httpd.conf文件:
vim /etc/httpd/conf/httpd.conf
apache默认就是使用80端口
3、防火墙开放80端口
开启防火墙
systemctl start firewalld
查看防火墙状态
systemctl status firewalld
看到绿色的 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