1.安装
yum -y install httpd

2.开启apache服务
systemctl start httpd.service

3.设置apache服务开机启动
systemctl enable httpd.service

4.验证apache服务是否安装成功
默认情况下apache的目录在/var/www/html 里面有一个默认的页面
在本机浏览器中输入虚拟机的ip地址或者输入命令 curl
curl http://localhost |

5. 防火墙设置
firewall-cmd --permanent --zone=public --add-service=http firewall-cmd --permanent --zone=public --add-service=https firewall-cmd --reload |

外网通过IP访问

文章评论