1.配置yum源
[base]name=CentOS-$releasever - Base - mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos/7/os/x86_64/gpgcheck=1enabled=1gpgkey=http://mirrors.aliyun.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7
2.更新yum源
yum updateyum upgrade yum clear allyum makecache
3.安装httpd服务
yum -y install httpd
4.启动httpd服务
systemctl start httpd.server
5.为了让其他的客户端能访问到httpd 服务,必须关闭selinux和允许其他的主机通过防火墙
setenforce 0iptables -F
6.测试
注意:在/var/www/下查看是否有html文件,没有则自己添加一个即可。
还有在阿里云官方下载的repo包下载下来之后一直报错,上面的baseurl是我自己改过之后可以用的。