加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

yum install nginx

发布时间:2020-12-16 01:40:39 所属栏目:安全 来源:网络整理
导读:Installation instructions Before you install nginx for the first time on a new machine,you need to set up the nginx packages repository. Afterward,you can install and update nginx from the repository. RHEL/CentOS Install the prerequisites:

Installation instructions

Before you install nginx for the first time on a new machine,you need to set up the nginx packages repository. Afterward,you can install and update nginx from the repository.

RHEL/CentOS

Install the prerequisites:

sudo yum install yum-utils

To set up the yum repository,create the file named?/etc/yum.repos.d/nginx.repo?with the following contents:

[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

By default,the repository for stable nginx packages is used. If you would like to use mainline nginx packages,run the following command:

sudo yum-config-manager --enable nginx-mainline

To install nginx,run the following command:

sudo yum install nginx

When prompted to accept the GPG key,verify that the fingerprint matches?573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62,and if so,accept it.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读