This article explains how to install Plus on Red Hat Enterprise , , Oracle Linux, Linux, , , SLES and .

Prerequisites

Prior to installing NGINX Plus, you should have:

  • Purchased NGINX Plus subscription
  • privileges
  • E-mail containing your credentials to NGINX Plus Customer Portal
  • E-mail containing links to your personal nginx-repo.crt and nginx-repo.key files.
NGINX Plus packages are available for the following distributions and versions:
  • RHEL/CentOS/Oracle Linux
    • 6.5+
    • 7.0+
  • Debian
    • 7 (Wheezy)
    • 8 (Jessie)
    • 9 (Stretch)
  • SLES
    • 12
    • 12 SP1
  • Ubuntu
    • 14.04 (Trusty)
    • 16.04 (Xenial)
    • 17.04 (Zesty)
  • FreeBSD
    • 10.1+
    • 11.0+
  • Amazon Linux

Installing NGINX Plus on RHEL, CentOS, Oracle Linux and Amazon Linux

NGINX Plus can be installed on Red Hat Enterprise Linux, CentOS and Oracle Linux 6.5+ and 7.0+, and Amazon Linux.

To install NGINX Plus on RHEL, CentOS, Oracle Linux and Amazon Linux:

  1. Create the /etc/ssl/nginx directory:
    $ sudo mkdir /etc/ssl/nginx
    $ cd /etc/ssl/nginx
  2. Log in to NGINX Plus Customer Portal and download your version of nginx-repo.crt and nginx-repo.key files.
  3. Copy the files to /etc/ssl/nginx/ directory:
    $ sudo cp nginx-repo.crt /etc/ssl/nginx/
    $ sudo cp nginx-repo.key /etc/ssl/nginx/
  4. Install ca-certificates:
    $ sudo yum install ca-certificates
  5. Download the nginx-plus-repo file and copy it to the to /etc/yum.repos.d/ directory. Each version RHEL, CentOS, Oracle Linux or Amazon Linux has its own repo file.
    • For RHEL6, CentOS6 or Oracle Linux6 run the :
      $ sudo wget -P /etc/yum.repos.d https://cs.nginx.com/static/files/nginx-plus-6.repo
    • For RHEL7, CentOS7 or Oracle Linux7 run the command:
      $ sudo wget -P /etc/yum.repos.d https://cs.nginx.com/static/files/nginx-plus-7.repo
    • For Amazon Linux run the command:
      $ sudo wget -P /etc/yum.repos.d https://cs.nginx.com/static/files/nginx-plus-amazon.repo
  6. Install the nginx-plus package. If there is an older NGINX Plus package installed, it will be replaced:
    $ sudo yum install nginx-plus

Installing NGINX Plus on Debian and Ubuntu

NGINX Plus can be installed on Debian 7 (Wheezy), Debian 8 (Jessie), Debian 9 (Stretch), Ubuntu 14.04 (Trusty), Ubuntu 16.04 (Xenial), and Ubuntu 17.04 (Zesty).

To install NGINX Plus on Debian or Ubuntu:

  1. Create the /etc/ssl/nginx directory:
    $ sudo mkdir /etc/ssl/nginx
    $ cd /etc/ssl/nginx
  2. Log in to NGINX Plus Customer Portal.
  3. Download your version of nginx-repo.crt and nginx-repo.key files from NGINX Plus Customer Portal and copy the files to /etc/ssl/nginx/ directory:
    $ sudo cp nginx-repo.crt /etc/ssl/nginx/
    $ sudo cp nginx-repo.key /etc/ssl/nginx/
  4. Download the NGINX signing key from nginx.org and add it:
    $ sudo wget http://nginx.org/keys/nginx_signing.key
    $ sudo apt-key add nginx_signing.key
  5. Install apt-utils package and install NGINX Plus repository.
    • For Debian, run the commands:
      $ sudo apt-get install apt-transport-https lsb-release ca-certificates
      $ printf "deb https://plus-pkgs.nginx.com/debian `lsb_release -cs` nginx-plus\n" | sudo tee /etc/apt/sources.list.d/nginx-plus.list
    • For Ubuntu, run the commands:
      $ sudo apt-get install apt-transport-https lsb-release ca-certificates
      $ printf "deb https://plus-pkgs.nginx.com/ubuntu `lsb_release -cs` nginx-plus\n" | sudo tee /etc/apt/sources.list.d/nginx-plus.list
  6. Download the “90nginx” file to /etc/apt/apt.conf.d:
    $ sudo wget -q -O /etc/apt/apt.conf.d/90nginx https://cs.nginx.com/static/files/90nginx
  7. Update the repository information:
    $ sudo apt-get update
  8. Install the nginx-plus package. If there is an older NGINX Plus package installed, it will be replaced:
    $ sudo apt-get install -y nginx-plus

Installing NGINX Plus on SUSE Linux Enterprise

NGINX Plus can be installed on SUSE Linux Enterprise Server 12 and on SUSE Linux Enterprise Server 12 SP1.

To install NGINX Plus on SUSE Linux Enterprise Server:

  1. Create the /etc/ssl/nginx directory:
    $ sudo mkdir /etc/ssl/nginx
    $ cd /etc/ssl/nginx
  2. Log in to NGINX Plus Customer Portal.
  3. Download your version of nginx-repo.crt and nginx-repo.key files from NGINX Plus Customer Portal and create a file that contains an nginx-repo SSL certificate and key:
    $ cat /etc/ssl/nginx/nginx-repo.crt /etc/ssl/nginx/nginx-repo.key > /etc/ssl/nginx/nginx-repo-bundle.crt
  4. Install required dependencies:
    $ zypper install ca-certificates
  5. Add the nginx-plus repo:
    $ zypper addrepo -G -t yum -c 'https://plus-pkgs.nginx.com/sles/12?ssl_clientcert=/etc/ssl/nginx/nginx-repo-bundle.crt&ssl_verify=host' nginx-plus
  6. Install the nginx-plus package. If there is an older NGINX Plus package installed, it will be replaced:
    $ zypper install nginx-plus

Installing NGINX Plus on FreeBSD

NGINX Plus can be installed on FreeBSD 10.1+ and 11.0.

To install NGINX Plus on FreeBSD:

  1. Create the /etc/ssl/nginx directory:
    $ sudo mkdir -p /etc/ssl/nginx
    $ cd /etc/ssl/nginx
  2. Install prerequisite packages:
    $ sudo pkg install ca_root_nss
  3. Log in to NGINX Plus Customer Portal.
  4. Download your version of nginx-repo.crt and nginx-repo.key files from NGINX Plus Customer Portal and copy the files to the /etc/ssl/nginx/ directory:
    $ sudo cp nginx-repo.crt /etc/ssl/nginx/
    $ sudo cp nginx-repo.key /etc/ssl/nginx/
  5. Copy nginx-plus.conf file to /etc/pkg/ directory:
    $ sudo fetch -O /etc/pkg/nginx-plus.conf http://cs.nginx.com/static/files/nginx-plus.conf
  6. Add the following lines to the /usr/local/etc/pkg.conf file:
    PKG_ENV: { SSL_NO_VERIFY_PEER: "1",
    SSL_CLIENT_CERT_FILE: "/etc/ssl/nginx/nginx-repo.crt",
    SSL_CLIENT_KEY_FILE: "/etc/ssl/nginx/nginx-repo.key" }
  7. Install the nginx-plus package. If there is an older NGINX Plus package installed, it will be replaced:
    $ sudo pkg install nginx-plus

Installing Dynamically Loadable Modules

NGINX Plus functionality can be extended with dynamically loadable modules:

Installing Modules From Repository

NGINX-authored and NGINX-certified dynamic modules can be installed directly from the modules repository. To install the modules:

  • for RHEL, CentOS, Oracle Linux and Amazon Linux, run the command:
    # yum install module-name
  • for Debian or Ubuntu, run the command:
    # apt-get install module-name
  • for SUSE Linux Enterprise Server, run the command:
    # zypper install module-name
  • for FreeBSD, run the command:
    # pkg install module-name

Note that some modules are not available for certain OS versions because of OS limitations. For details as well as descriptions of the modules, see the NGINX Plus Technical Specifications.

After you have installed the module, you will need to enable it in the NGINX configuration file. See Enabling Dynamic Modules for details.

[[email protected] conf.d]# yum search nginx-plus
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.vinahost.vn
* epel: mirror.vinahost.vn
* extras: centos-hcm.viettelidc.com.vn
* updates: mirror.vinahost.vn
======================================================================= N/S matched: nginx-plus ========================================================================
nginx-plus-debuginfo.x86_64 : Debug information for package nginx-plus
nginx-plus-extras-debuginfo.x86_64 : Debug information for package nginx-plus-extras
nginx-plus-http2-debuginfo.x86_64 : Debug information for package nginx-plus-http2
nginx-plus-lua-debuginfo.x86_64 : Debug information for package nginx-plus-lua
nginx-plus-module-geoip-debuginfo.x86_64 : Debug information for package nginx-plus-module-geoip
nginx-plus-module-geoip2-debuginfo.x86_64 : Debug information for package nginx-plus-module-geoip2
nginx-plus-module-headers-more-debuginfo.x86_64 : Debug information for package nginx-plus-module-headers-more
nginx-plus-module-image-filter-debuginfo.x86_64 : Debug information for package nginx-plus-module-image-filter
nginx-plus-module-lua-debuginfo.x86_64 : Debug information for package nginx-plus-module-lua
nginx-plus-module-ndk-debuginfo.x86_64 : Debug information for package nginx-plus-module-ndk
nginx-plus-module-njs-debuginfo.x86_64 : Debug information for package nginx-plus-module-njs
nginx-plus-module-passenger-debuginfo.x86_64 : Debug information for package nginx-plus-module-passenger
nginx-plus-module-perl-debuginfo.x86_64 : Debug information for package nginx-plus-module-perl
nginx-plus-module-rtmp-debuginfo.x86_64 : Debug information for package nginx-plus-module-rtmp
nginx-plus-module-set-misc-debuginfo.x86_64 : Debug information for package nginx-plus-module-set-misc
nginx-plus-module-subs-filter-debuginfo.x86_64 : Debug information for package nginx-plus-module-subs-filter
nginx-plus-module-wallarm-debuginfo.x86_64 : Debug information for package nginx-plus-module-wallarm
nginx-plus-module-xslt-debuginfo.x86_64 : Debug information for package nginx-plus-module-xslt
nginx-plus-sms-debuginfo.x86_64 : Debug information for package nginx-plus-sms
nginx-plus.x86_64 : NGINX Plus, provided by Nginx, Inc.
nginx-plus-debug.x86_64 : NGINX Plus, provided by Nginx, Inc. (debug build)
nginx-plus-extras.x86_64 : NGINX Plus Extras, provided by Nginx, Inc.
nginx-plus-extras-debug.x86_64 : NGINX Plus Extras, provided by Nginx, Inc. (debug build)
nginx-plus-http2.x86_64 : NGINX Plus HTTP/2, provided by Nginx, Inc.
nginx-plus-http2-debug.x86_64 : NGINX Plus HTTP/2, provided by Nginx, Inc. (debug build)
nginx-plus-lua.x86_64 : NGINX Plus Lua, provided by Nginx, Inc.
nginx-plus-lua-debug.x86_64 : NGINX Plus Lua, provided by Nginx, Inc. (debug build)
nginx-plus-module-geoip.x86_64 : NGINX Plus, provided by Nginx, Inc. (GeoIP dynamic modules)
nginx-plus-module-geoip2.x86_64 : NGINX Plus, provided by Nginx, Inc. (3rd-party GeoIP2 dynamic modules)
nginx-plus-module-headers-more.x86_64 : NGINX Plus, provided by Nginx, Inc. (3rd-party headers-more dynamic module)
nginx-plus-module-image-filter.x86_64 : NGINX Plus, provided by Nginx, Inc. (image filter dynamic module)
nginx-plus-module-lua.x86_64 : NGINX Plus, provided by Nginx, Inc. (3rd-party Lua dynamic module)
nginx-plus-module-ndk.x86_64 : NGINX Plus, provided by Nginx, Inc. (3rd-party NDK dynamic module)
nginx-plus-module-njs.x86_64 : NGINX Plus, provided by Nginx, Inc. (nginScript dynamic modules)
nginx-plus-module-passenger.x86_64 : NGINX Plus, provided by Nginx, Inc. (3rd-party Passenger dynamic module)
nginx-plus-module-perl.x86_64 : NGINX Plus, provided by Nginx, Inc. (Perl dynamic module)
nginx-plus-module-rtmp.x86_64 : NGINX Plus, provided by Nginx, Inc. (3rd-party RTMP dynamic module)
nginx-plus-module-set-misc.x86_64 : NGINX Plus, provided by Nginx, Inc. (3rd-party set-misc dynamic module)
nginx-plus-module-subs-filter.x86_64 : NGINX Plus, provided by Nginx, Inc. (3rd-party substitution dynamic module)
nginx-plus-module-wallarm.x86_64 : NGINX Plus, provided by Nginx, Inc. (3rd-party Wallarm dynamic module)
nginx-plus-module-xslt.x86_64 : NGINX Plus, provided by Nginx, Inc. (xslt dynamic module)
nginx-plus-sms.x86_64 : NGINX Plus Media Server, provided by Nginx, Inc.
nginx-plus-sms-debug.x86_64 : NGINX Plus Media Server, provided by Nginx, Inc. (debug build)

Name and summary matches only, use “search all” for everything.

Installing NGINX Community Modules

In order to build a community dynamic module to work with NGINX Plus, it must be compiled alongside the corresponding open source NGINX version.

  1. Prepare build environment.It is strongly recommend that you compile dynamic modules on a separate system we will refer to as the “build environment”. Doing so minimizes the risk and complexity of the system you plan to upgrade NGINX plus on (we will refer to this as the “production environment”). The build environment should meet the following requirements:
    • the same operating system as the production environment
    • the same NIGNX version as the production environment
    • Compiler and make utilities
    • PCRE library (development files)
    • Zlib compression libraries (development files)

    To ensure your build environment has these prerequisites installed, execute the command

    for Ubuntu/Debian:

    buildenv$ sudo apt-get install gcc make libpcre3-dev zlib1g-dev

    for CentOS/RHEL/Oracle Linux:

    buildenv$ sudo yum install gcc make pcre-devel zlib-devel
  2. Obtain open source NGINX
    • Identify the corresponding open source NGINX version for NGINX Plus: visit the NGINX Plus Releases page and make a note of the NGINX open source build version.
    • Download the sources for the open source NGINX version, in this case 1.13.3.
      buildenv$ wget -qO - http://nginx.org/download/nginx-1.13.3..gz |  zxfv -
  3. Obtain the Dynamic Module sourcesThe sources for the dynamic module can exist anywhere on the build environment. In this example we copy the sample “hello world” module from its GitHub repository:
    buildenv$ git clone https://github.com/perusio/nginx-hello-world-module.git
  4. Compile the Dynamic ModuleCompile the module by first running the configure script with the ‑‑with‑compat argument to ensure compatibility between open source NGINX and NGINX Plus. Then run make modules to compile the module only.
    buildenv$ cd nginx-1.13.3/
    buildenv$ ./configure --with-compat --add-dynamic-module=../module_sources
    buildenv$ make modules

    The build process will produce the dynamic module as a .so file in the objs subdirectory.

    buildenv$ ls objs/*.so
    objs/ngx_http_hello_world.so
  5. Make a copy of the module file so that it includes the open source NGINX version in the filename. This will make it simpler to manage multiple versions of the Dynamic Module in the production environment.
    buildenv$ cp objs/ngx_http_hello_world.so ./ngx_http_hello_world_1.13.3.so

Enabling Dynamic Modules

Dynamic modules are located in the /etc/nginx/modules directory, which is created automatically at NGINX installation.

To enable a dynamic module:

  1. In the main (top-level) context in /etc/nginx/nginx.conf, add a load_module directive for each dynamically loadable module you installed.
    load_module modules/module-name.so;
  2. Check the new configuration for syntactic validity and reload NGINX Plus.
    # nginx -t && nginx -s reload

Upgrading NGINX Plus

To upgrade your NGINX Plus installation to the newest version:

  1. If you already have old NGINX packages in your system, back up your configs and logs.
    • For Linux distributions, run the commands:
      sudo cp -a /etc/nginx /etc/nginx-plus-backup
      sudo cp -a /var/log/nginx /var/log/nginx-plus-backup
    • For FreeBSD, run the commands:
      sudo cp -a /usr/local/etc/nginx /usr/local/etc/nginx-plus-backup
      sudo cp -a /var/log/nginx /var/log/nginx-plus-backup
  2. Upgrade your NGINX Plus installation.
    • for RHEL, CentOS, Oracle Linux or Amazon Linux, run the command:
      $ sudo yum upgrade nginx-plus

      Note: when upgrading to RHEL, CentOS, or Oracle Linux version 6.6, see this advisory.

    • for Debian or Ubuntu, run the commands:
      $ sudo apt-get update
      $ sudo apt-get install nginx-plus
    • for FreeBSD, run the command:
      $ sudo pkg upgrade nginx-plus

After the upgrade is finished, you may check the NGINX Plus version:

$ nginx -v
nginx version: nginx/1.13.3 (nginx-plus-r13)

Upgrading NGINX Plus Modules

The upgrade procedure depends on how the module was supplied and installed.

  • NGINX-authored and NIGNX-certified community dynamic modules – will be updated automatically together with NGINX Plus.
  • Community dynamic modules – must be recompiled alongside the corresponding open source NGINX version. See Installing NGINX Community Modules for a detailed procedure.

Source: https://www.nginx.com/resources/admin-guide/installing-nginx-plus/

Print Friendly, PDF & Email

Comments

comments

Bài viết liên quan