`

centos下yum nginx 的安装

阅读更多

 

Pre-Built Packages for Stable version

To set up the yum repository for RHEL/CentOS, choose the corresponding nginx-release package from the list:

This package contains yum configuration file and a public PGP key necessary to authenticate signed RPMs. Download and install it, then run the following:

yum install nginx

Alternatively, a repository configuration can be added manually without installing the nginx-release package. Create the file named/etc/yum.repos.d/nginx.repo with the following contents:

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/
gpgcheck=0
enabled=1

Replace “OS” with “rhel” or “centos”, depending on the distribution used, and “OSRELEASE” with “5” or “6”, for 5.x or 6.x versions, respectively.

For Debian/Ubuntu, in order to authenticate the nginx repository signature and to eliminate warnings about missing PGP key during installation of the nginx package, it is necessary to add the key used to sign the nginx packages and repository to the aptprogram keyring. Please download this key from our web site, and add it to the apt program keyring with the following command:

sudo apt-key add nginx_signing.key

 

For Debian replace codename with Debian distribution codename, and append the following to the end of the /etc/apt/sources.listfile:

deb http://nginx.org/packages/debian/ codename nginx
deb-src http://nginx.org/packages/debian/ codename nginx

 

For Ubuntu replace codename with Ubuntu distribution codename, and append the following to the end of the /etc/apt/sources.listfile:

deb http://nginx.org/packages/ubuntu/ codename nginx
deb-src http://nginx.org/packages/ubuntu/ codename nginx

 

For Debian/Ubuntu then run the following commands:

apt-get update
apt-get install nginx

 

Pre-Built Packages for Mainline version

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

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/mainline/OS/OSRELEASE/$basearch/
gpgcheck=0
enabled=1

Replace “OS” with “rhel” or “centos”, depending on the distribution used, and “OSRELEASE” with “5” or “6”, for 5.x or 6.x versions, respectively.

For Debian/Ubuntu, in order to authenticate the nginx repository signature and to eliminate warnings about missing PGP key during installation of the nginx package, it is necessary to add the key used to sign the nginx packages and repository to the aptprogram keyring. Please download this key from our web site, and add it to the apt program keyring with the following command:

sudo apt-key add nginx_signing.key

 

For Debian replace codename with Debian distribution codename, and append the following to the end of the /etc/apt/sources.listfile:

deb http://nginx.org/packages/mainline/debian/ codename nginx
deb-src http://nginx.org/packages/mainline/debian/ codename nginx

 

For Ubuntu replace codename with Ubuntu distribution codename, and append the following to the end of the /etc/apt/sources.listfile:

deb http://nginx.org/packages/mainline/ubuntu/ codename nginx
deb-src http://nginx.org/packages/mainline/ubuntu/ codename nginx

 

For Debian/Ubuntu then run the following commands:

apt-get update
apt-get install nginx

 

Signatures

Both RPM packages and Debian/Ubuntu repositories use digital signatures to verify the integrity and origin of the downloaded package. In order to check a signature it is necessary to download nginx signing key and import it to the rpm or apt program’s keyring:

  • On Debian/Ubuntu:
    sudo apt-key add nginx_signing.key
  • On RHEL/CentOS:
    sudo rpm --import nginx_signing.key

 

On Debian/Ubuntu signatures are checked by default, but on RHEL/CentOS it is necessary to set

gpgcheck=1

in the /etc/yum.repos.d/nginx.repo file.

Since our PGP keys and packages are located on the same server, they are equally trusted. It is highly advised to additionally verify the authenticity of the downloaded PGP key. PGP has the “Web of Trust” concept, when a key is signed by someone else’s key, that in turn is signed by another key and so on. It often makes possible to build a chain from an arbitrary key to someone’s key who you know and trust personally, thus verify the authenticity of the first key in a chain. This concept is described in details in GPG Mini Howto. Our keys have enough signatures, and their authenticity is relatively easy to check.

分享到:
评论

相关推荐

    yum 安装 Nginx (Centos)

    yum 安装 Nginx 为懒人准备。 第三方yum源(CentOS默认的标准源里没有nginx软件包)

    CentOS 7 yum 安装 Nginx

    CentOS 7 yum 安装 Nginx,1.Nginx到YUM源2.安装Nginx3.启动Nginx4.CentOS 7 开机启动Nginx5.Nginx配置信息

    Centos7环境下Nginx版本升级方式及步骤

     YUM upgrade升级:本方式适用于使用rpm安装nginx的方式,优点是升级操作简单便捷,缺点是无法升级到指定版本,默认升级至YUM安装支持的最新版本,当前最新版本为nginx1.18.0。  源码平滑升级升级:本方式适用于...

    centos6.5通过yum安装nginx

    主要为大家详细介绍了centos6.5通过yum安装nginx的相关步骤,linux安装nginx以及配置,具有一定的参考价值,感兴趣的小伙伴们可以参考一下

    nginx1.20.1_使用yum install增加 stream模块(非编译)

    centos7.9yum装nginx1.20.1关于stream模块失效的报错,如unknown directive “stream” in /etc/nginx/nginx.conf(非编译安装)

    centos7 nginx离线安装包 nginx-1.20.1-2.el7.x86_64

    在完全无互联网连接的情况下,离线安装nginx。 nginx版本号:nginx-1.20.1-2.el7.x86_64 食用方法: 1.解压 2.进入解压目录 3.rpm安装全部 4.安装完成

    CentOS 6.2 yum安装配置lnmp服务器(Nginx+PHP+MySQL)

    CentOS 6.2 yum安装配置lnmp服务器(Nginx+PHP+MySQL)

    Centos7安装Nginx或OpenResty1

    二、yum安装Nginx1.添加nginx的yum源Centos7自带的yum repo仓库没有nginx安装包,所以要添加nginx的yum repo源文件,

    服务器CentOS 6.2 yum安装配置lnmp(Nginx+PHP+MySQL)

    服务器CentOS 6.2 yum安装配置lnmp(Nginx+PHP+MySQL)

    CentOS7下 yum方式安装Nginx的实现步骤

    CentOS7下 yum方式安装...如果是编译安装可以参考:Linux 6下安装编译安装Nginx 有关Nginx的常用配置可参考:Nginx 概述及日常管理 一、配置nginx yum源 演示环境 [root@centos7-router ~]# more /etc/redhat-releas

    CentOS7 nginx+keepalived 离线安装包

    CentOS7 nginx+keepalived 离线安装包,解决离线环境下无法通过yum安装nginx和keepalived,这两版本可以组合安装实现高可靠性的主从热备负载均衡反向代理功能

    Centos光盘yum源搭建

    Centos光盘yum源搭建,Centos6,Cento7搭建方法一样;安装rpm包时,一条命令快速安装rpm,免去rpm依赖性

    详解CentOS配置Nginx官方的Yum源

    install nginx不能安装nginx,本地centos系统的yum仓库并没有nginx,查找资料得以解决,做记录如下: 由于yum源中没有我们想要的nginx,那么我们就需要创建一个“/etc/yum.repos.d/nginx.repo”的文件,其实就是...

    Linux/Centos/RHEL yum 安装/部署 Nginx

    官网文档翻译. www.nginx.org 安装先决条件: sudo yum install yum-utils ...baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=1 enabled=1 gpgkey=https://nginx.org/keys/ngin

    Redhat 使用CentOS的yum源进行升级或软件安装

    Redhat 使用CentOS的yum源进行升级或软件安装 分类: linux 2012-07-19 15:54 1113人阅读 评论(0) 收藏 举报 Redhat默认的源不但速度不给力,而且软件版本陈旧,今天试着将Redhat默认源替换为CentOS的163源,发现...

    阿里云centos7安装Nginx

    执行命令:yum info nginx 查看资源库中可以安装的nginx软件包信息。这里可安装的软件包nginx 1.16.1版本。如下图所示: 2.2直接使用yum安装nginx 执行命令:yum install nginx -y 安装nginx。如下图所示: 2.3...

    Centos8搭建本地yum源与局域网yum源.docx

    局域网搭建centos8 yum源,使用http协议,nginx服务器

    CentOS7系统下用YUM安装Nginx详解

    相信大家都知道Nginx ("engine x") 是一个高性能的 HTTP和反向代理服务器,也是一个 IMAP/POP3/SMTP...这篇文章将详细给大家介绍在CentOS7系统下用YUM安装Nginx的方法,有需要的朋友们可以参考借鉴,下面来一起看看吧。

Global site tag (gtag.js) - Google Analytics