nginx1.16安装

参考:https://nginx.org/en/linux_packages.html#RHEL-CentOS

1.必备条件

sudo yum install yum-utils

2.设置云仓库

创建文件:

vi /etc/yum.repos.d/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
module_hotfixes=true

[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
module_hotfixes=true

3.安装nginx

sudo yum install nginx

 

 

你可能感兴趣的:(nginx,centos,nginx安装)