linux下安装nginx

备份yum源

cd /etc/yum.repos.d
mkdir repo_bak
mv *.repo repo_bak/

下载阿里云repo文件

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

清空yum缓存并且生成新的yum缓存

yum clean all
yum makecache

安装软件扩展源

yum install -y epel-release

查看更换的源

yum repolist

linux下安装nginx

安装nginx

yum install nginx

启动

systemctl start nginx

网页查看

在浏览器上输入阿里云你自己服务器的ip地址,访问即可,如下表示启动成功

linux下安装nginx

上一篇:linux 用yum安装包报错All mirror URLs are not using ftp, http[s] or file.的解决方案


下一篇:centos7 minimal安装之后要做的事情