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 apt
program 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.list
file:
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.list
file:
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 apt
program 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.list
file:
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.list
file:
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.
相关推荐
### CentOS 7 使用 YUM 安装 Nginx #### 一、添加 Nginx 到 YUM 源 为了能够使用 YUM 命令安装 Nginx,我们首先需要将 Nginx 的软件仓库添加到 CentOS 7 系统中。这一步非常重要,因为它确保了系统能够找到并下载...
本文将详细介绍如何在CentOS 7.6上进行离线安装Nginx,这对于网络环境不稳定或者没有互联网连接的服务器尤为实用。 首先,确保你的系统是最新的。打开终端并运行以下命令来更新系统包: ```bash sudo yum update -...
本篇文章将详细介绍两种在CentOS7上升级Nginx的方法:YUM upgrade和源码平滑升级,并提供相关的步骤和注意事项。 ### YUM upgrade 升级 YUM upgrade适用于已经使用RPM方式安装Nginx的用户。这种升级方式简单快捷,...
### CentOS 7 下安装 Nginx (有网络与无网络环境) #### 一、概述 Nginx 是一款广泛使用的高性能 HTTP 和反向代理 Web 服务器,同时也提供了 IMAP/POP3/SMTP 服务。其特点是占有内存少,并发能力强,事实上很多网站...
在本教程中,我们将探讨如何在CentOS 6.5上进行一键安装Nginx的过程,以及相关的配置和注意事项。 首先,我们需要确保系统是root权限,因为安装和配置Nginx需要修改系统文件。可以使用`sudo su`或`su -`命令切换到...
本指南将详细解释如何在 CentOS 6.3 环境下安装 Nginx,以及涉及到的源码编译与工具使用。 首先,确保系统是最新的。打开终端,输入以下命令更新系统软件包: ```bash yum update -y ``` 接下来,安装必要的构建...
4. **安装Nginx**:假设你已经获取了Nginx的离线安装包(`.rpm`文件),同样使用 `yum localinstall` 来安装Nginx。如果尚未下载,可以通过其他已联网的系统下载并传输。 5. **配置Nginx**:安装完成后,根据需求...
### CentOS 7 安装 Nginx 1.16.1 #### 一、概述 本篇文章将详细介绍如何在 CentOS 7 上安装 Nginx 1.16.1 版本。Nginx 是一款轻量级的 Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,由俄罗斯的...
本文将详细介绍如何通过YUM包管理器在CentOS 6.5上安装Nginx以及进行基本的配置。 首先,我们需要确保系统的更新是最新的,可以通过执行以下命令来更新系统: ```bash yum update ``` 在尝试安装Nginx时,可能会...
#### 二、CentOS8环境下Nginx的安装与配置 ##### 2.1 安装前准备 在安装Nginx之前,我们需要确保系统已经安装了一些必要的编译工具和库文件,这些工具和库文件对于Nginx的成功编译和运行至关重要。 **Nginx依赖...
标题 "CentOS自动安装nginx" 涉及到的主要知识点是Linux系统管理,特别是针对CentOS发行版,以及网络服务器软件Nginx的自动化部署。Nginx是一款高性能的HTTP和反向代理服务器,常用于网站托管,因为它具有高并发处理...
"CentOS 7.4 下安装 Nginx 1.16.0" 在 CentOS 7.4 操作系统中安装 Nginx 1.16.0 需要遵循以下步骤: 一、下载 Nginx 安装包 首先,需要切换到 `/usr/local` 目录下,然后下载 Nginx 1.16.0 的安装包。可以使用 ...
离线安装Nginx在没有网络的环境下尤其有用,但需要注意的是,这种方式可能会错过一些安全更新和新功能。在能够联网的环境中,推荐使用`yum`或`dnf`等包管理器进行安装和更新,以确保系统的安全性与稳定性。
内网环境下的CentOS7系统安装Nginx是一项常见的任务,尤其在没有互联网连接或者网络受限的情况下。Nginx是一款高性能的HTTP和反向代理服务器,广泛用于网站托管和负载均衡。下面将详细介绍如何在CentOS7的内网环境中...
本压缩包"centOS7离线安装nginx依赖包.zip"显然是为了帮助用户在没有网络连接的环境中在CentOS 7上安装Nginx。离线安装意味着我们需要预先准备所有必要的依赖包,以便在目标机器上进行安装。 首先,了解Nginx的基本...
### CentOS 6.6 安装 Nginx 1.12 教程 #### 一、概述 本文档提供了一套详细的指南用于在 CentOS 6.6 系统上安装 Nginx 1.12 版本,并且包含了如何配置开机自启的过程。通过以下步骤,用户可以确保 Nginx 在 CentOS ...
yum 安装 Nginx 为懒人准备。 第三方yum源(CentOS默认的标准源里没有nginx软件包)
在CentOS7上安装Nginx有两种主要方式:源码安装和Yum安装。 **源码安装** 1. **安装依赖**:首先,确保系统中已经安装了必要的编译工具和库,如GCC、pcre、zlib和openssl等。可以通过以下命令安装: ``` sudo ...
请注意,由于CentOS 6.x使用的是旧版的`yum`,在离线环境下,安装依赖包可能需要手动解决一些依赖关系。如果在编译或安装过程中遇到问题,可能需要查阅官方文档或社区论坛寻求帮助。此外,如果你的服务器有防火墙,...