标签:执行 lin gpg top version restart repo service baseurl
到 cd /etc/yum.repos.d/ 目录下
新建nginx.repo 文件
vim nginx.repo
输入以下信息
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
通过yum search nginx看看是否已经添加源成功。如果成功则执行下列命令安装nginx。
yum install -y nginx
三、启动nginx
service nginx start
service nginx stop
service nginx restart
nginx -v
nginx version: nginx/1.16.1
service nginx start
标签:执行 lin gpg top version restart repo service baseurl
原文地址:https://www.cnblogs.com/programer-xinmu78/p/11791486.html