1、指令直接安装
首先关闭apache服务
yum install httpd # 中间过程中输入:y
2、修改配置文件:yum的安装位置在:/etc/httpd/conf
# 放掉95行的注释,修改为:
ServerName [你的IP]:80
3、启动服务
systemctl start httpd.service
4、关闭服务
systemctl stop httpd.service
5、重启服务
systemctl restart httpd.service
6 设置开机自动启动:
chkconfig httpd on