nginx瀹夎鏁欑▼

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nginx瀹夎鏁欑▼相关的知识,希望对你有一定的参考价值。

鏍囩锛?/p>

nginx: Linux packages

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

RHEL/CentOS:

Version Supported Platforms
5.x x86_64, i386
6.x x86_64, i386
7.x x86_64

 

Debian:

Version Codename Supported Platforms
7.x wheezy x86_64, i386
8.x jessie x86_64, i386

 

Ubuntu:

Version Codename Supported Platforms
12.04 precise x86_64, i386
14.04 trusty x86_64, i386, aarch64/arm64
15.10 wily x86_64, i386
16.04 xenial x86_64, i386

 

SLES:

Version Supported Platforms
12 x86_64

 

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, 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 鈥榟ttp://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 鈥榟ttp://nginx.org/packages/mainline/sles/12鈥?nginx

 

Configure Arguments

Configure arguments common for nginx binaries from pre-built packages:

--prefix=/etc/nginx
--sbin-path=/usr/sbin/nginx
--conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error.log
--http-log-path=/var/log/nginx/access.log
--pid-path=/var/run/nginx.pid
--lock-path=/var/run/nginx.lock
--http-client-body-temp-path=/var/cache/nginx/client_temp
--http-proxy-temp-path=/var/cache/nginx/proxy_temp
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp
--http-scgi-temp-path=/var/cache/nginx/scgi_temp
--user=nginx
--group=nginx
--with-http_ssl_module
--with-http_realip_module
--with-http_addition_module
--with-http_sub_module
--with-http_dav_module
--with-http_flv_module
--with-http_mp4_module
--with-http_gunzip_module
--with-http_gzip_static_module
--with-http_random_index_module
--with-http_secure_link_module
--with-http_stub_status_module
--with-http_auth_request_module
--with-threads
--with-stream
--with-stream_ssl_module
--with-http_slice_module
--with-mail
--with-mail_ssl_module
--with-file-aio
--with-http_v2_module
--with-ipv6

 

Main nginx package is built with all modules that do not require additional libraries to avoid extra dependencies.

Dynamic Modules

Since version 1.9.11, nginx supports dynamic modules. Currently, the following modules are built as dynamic and shipped as separate packages:

nginx-module-geoip
nginx-module-image-filter
nginx-module-njs
nginx-module-perl
nginx-module-xslt

 

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.

以上是关于nginx瀹夎鏁欑▼的主要内容,如果未能解决你的问题,请参考以下文章

mac锛欸o瀹夎鍜岄厤缃?GoLand瀹夎鍜屼娇鐢ㄤ箣瀹屾暣鏁欑▼

鍗氭ⅵ杞欢绠″ Microsoft Office 2019 瀹夎鏁欑▼

vmware瀹夎centos7鍥炬枃鏁欑▼

MySQL-8.0.11涓嶯avicat Premium瀹夎鏁欑▼

闃块噷浜戞湇鍔″櫒ECS Ubuntu18.04 鍒濇浣跨敤閰嶇疆鏁欑▼(鍥惧舰鐣岄潰瀹夎)

瀹夎Nginx