Nginx安装(yum)

Nginx安装-yum安装


安装 yum-utils

yum install yum-utils -y

在 /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

[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

[nginx-stable]源是默认开启的

使用 yum 安装 nginx

yum install nginx -y

你可能感兴趣的:(Nginx安装(yum))