redhat7配置阿里云的yum源并安装httpd服务

1.配置yum源

[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/7/os/x86_64/
gpgcheck=1
enabled=1
gpgkey=http://mirrors.aliyun.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7

2.更新yum源

yum update
yum upgrade 
yum clear all
yum makecache

3.安装httpd服务

yum -y install httpd

4.启动httpd服务

systemctl start httpd.server

5.为了让其他的客户端能访问到httpd 服务,必须关闭selinux和允许其他的主机通过防火墙

setenforce 0
iptables -F

6.测试


注意:在/var/www/下查看是否有html文件,没有则自己添加一个即可。

      还有在阿里云官方下载的repo包下载下来之后一直报错,上面的baseurl是我自己改过之后可以用的。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章