Nginx install

简介:

nginx: Linux packages

Currently, nginx packages are available for the following distributions and versions:

RHEL/CentOS:

Version
5.x
6.x
7.x

 

Debian:

Version Codename
6.x squeeze
7.x wheezy

 

Ubuntu:

Version Codename
10.04 lucid
12.04 precise
14.04 trusty
14.10 utopic

 

SLES:

Version
12

 

To enable automatic updates of Linux packages set up the yum repository for the RHEL/CentOS distributions, the apt repository for the Debian/Ubuntu distributions, or the zypper repository for SLES.

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-releasepackage. 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”, “6”, or “7”, for 5.x, 6.x, or 7.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 downloadthis 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

 

For SLES run the following command:

zypper addrepo -G -t yum -c 'http://nginx.org/packages/sles/12' 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”, “6”, or “7”, for 5.x, 6.x, or 7.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 downloadthis 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

 

For SLES run the following command:

zypper addrepo -G -t yum -c 'http://nginx.org/packages/mainline/sles/12' 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 downloadnginx 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 SLES:
    sudo rpm --import nginx_signing.key

 

On Debian/Ubuntu/SLES 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.

相关文章
|
5月前
|
应用服务中间件 nginx Docker
Ubuntu18 Install Nginx
Ubuntu18 Install Nginx
|
应用服务中间件 nginx
mac install nginx
下载 Nginx 源码包 下载页: http://nginx.org/en/download.html 当前稳定版本: http://nginx.org/download/nginx-1.8.0.tar.
2100 1
|
应用服务中间件 nginx
|
应用服务中间件 nginx 开发工具
|
Linux 应用服务中间件 nginx
CentOS 6.6 nginx install
/************************************************************************* * CentOS 6.6 nginx install * 说明: * 在VPS上安装nginx,以供有些时候无聊使用。
827 0
|
应用服务中间件 nginx Ubuntu
|
18天前
|
移动开发 前端开发 JavaScript
前端vue2、vue3去掉url路由“ # ”号——nginx配置(一)
前端vue2、vue3去掉url路由“ # ”号——nginx配置
52 0
|
18天前
|
JavaScript 前端开发 应用服务中间件
angular引入包、路由权限配置、打包问题与nginx配置问题(简单部署)
angular引入包、路由权限配置、打包问题与nginx配置问题(简单部署)
24 0
|
18天前
|
前端开发 JavaScript 应用服务中间件
前端vue2、vue3去掉url路由“ # ”号——nginx配置(二)
前端vue2、vue3去掉url路由“ # ”号——nginx配置
48 0
|
3天前
|
应用服务中间件 nginx
nginx配置集群轮训策略
nginx配置集群轮训策略
10 0