0%

通过yum源安装nginx

前置依赖,安装这个的目的是可以使用sudo yum-config-manager --enable nginx-mainline命令

1
sudo yum install yum-utils

创建yum仓库配置文件

/etc/yum.repo.d/nginx.repo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[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-mainlne]
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

安装nginx

1
sudo yum install nginx