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是我自己改過之後可以用的。


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