Installation

Installing From Repository

👍

Currently supported NGINX packages:

  • The official NGINX package shipped with Debian/Ubuntu.
  • The stable NGINX package from the official NGINX PPA.
  • The stable OpenResty package.

Dynamic PerimeterX NGINX module

Please contact PerimeterX support (via Slack, your customer success representative or one of the specified methods here) with the following information and we would provide you with an appropriate PerimeterX Nginx module:

  • The output of cat /etc/os-release
  • The output of nginx -V (capital V)

Installing From Source

Compiling and Installing PerimeterX NGNIX Module as a Dynamic Module

  1. Install the module dependencies:
apt update
apt install -y libjansson-dev libcurl4-openssl-dev libapr1-dev libaprutil1-dev libssl-dev build-essential devscripts libtool m4 automake pkg-config
yum update
yum install jansson-devel libcurl-devel openssl-devel apr-devel apr-util-devel gcc make libtool pcre-devel
  1. Run nginx -V to get the installed NGINX compilation flags.

  2. Copy the list of compilation flags which are next to configure arguments: string (i.e.: --with-cc-opt=... ). We will use this list of flags when we configure NGNIX with the PerimeterX module next.

  3. In your NGNIX source folder, run ./configure --add-dynamic-module=<PATH>/modules/nginx and append the list of compilation flags from the previous step.

Note: should be replaced with the full path to PerimeterX module's root folder from the source code.

Your configure command should look similar to this example:

./configure --add-dynamic-module=/home/ubuntu/perimeterx-c-core/modules/nginx --with-cc-opt='-g' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock
  1. Compile NGNIX and the PerimeterX dynamic module by running make from the NGNIX source folder.

  2. As a root user, copy the dynamic module from the objs folder to NGNIX's modules folder:

cp objs/ngx_http_pxnginx_module.so /usr/lib/nginx/modules/

Note: Depending on your distro, the NGNIX modules folder might be located under a different path.

  1. Add the following lines to the top of your nginx.conf file:
load_module /usr/lib/nginx/modules/ngx_http_pxnginx_module.so;
thread_pool px_pool threads=10;

Note: As noted on the previous step, the location of the ngx_http_pxnginx_module.so might be different in your setup.

Compiling and Installing PerimeterX NGNIX Module as a Built-In Module

  1. Install the module dependencies:
apt update
apt install -y libjansson-dev libcurl4-openssl-dev libapr1-dev libaprutil1-dev libssl-dev build-essential devscripts libtool m4 automake pkg-config
yum update
yum install jansson-devel libcurl-devel openssl-devel apr-devel apr-util-devel gcc make libtool
  1. In your NGNIX source folder, run ./configure --add-module=[PATH]/modules/nginx --with-threads.

Note: should be replaced with the full path to the PerimeterX module's root folder from the source code.

The configuration can look as follows:

./configure --add-module=/home/ubuntu/perimeterx-c-core/modules/nginx --with-threads [add extra NGINX compilation flags]
  1. Compile NGNIX by running the following commands:
make
sudo make install
  1. Add the following lines to the top of your nginx.conf file:
thread_pool px_pool threads=10;

Did this page help you?