U
UFHH01
Guest
Hi all Pleskians,
Global informations for this Plesk - contribution:
I noticed, that Plesk doesn't provide a decent solution/description/documentation on "How to compile NGINX with additional modules" yet and unfortunately, there is no KB - article for this as well, which provides the necessary steps.
Some Plesk - users just don't want to wait for NGINX features, which are global standards by now ( i.e. Google Pagespeed, the availability to use the "cache_purge" - module, or to use the "headers_more" - features ) and sometimes, they don't want to wait for Plesk updates/upgrades/patches for actual NGINX releases, to be "up-to-date" for their customers.
Pls. note, that this thread just describes the COMPILING STEPS and not possible NGINX - configurations, because that would go beyond the scope. If you desire help for depending configurations, pls. consider to open a NEW thread in the forum.
To start:
Be sure that you have the following packages installed on your server, before you start ( depending to your operating system, this list might vary! ):
Let's start with the "step-by-step guide":
Global informations for this Plesk - contribution:
I noticed, that Plesk doesn't provide a decent solution/description/documentation on "How to compile NGINX with additional modules" yet and unfortunately, there is no KB - article for this as well, which provides the necessary steps.
Some Plesk - users just don't want to wait for NGINX features, which are global standards by now ( i.e. Google Pagespeed, the availability to use the "cache_purge" - module, or to use the "headers_more" - features ) and sometimes, they don't want to wait for Plesk updates/upgrades/patches for actual NGINX releases, to be "up-to-date" for their customers.
Pls. note, that this thread just describes the COMPILING STEPS and not possible NGINX - configurations, because that would go beyond the scope. If you desire help for depending configurations, pls. consider to open a NEW thread in the forum.
To start:
Be sure that you have the following packages installed on your server, before you start ( depending to your operating system, this list might vary! ):
"gcc-c++" "pcre-devel" / "libpcre3"+"libpcre3-dev" "zlib-devel" / "zlib1g-dev" "make" "unzip" "Development Tools" "build-essential"
On CentOS/RHEL - based - systems, you could use the example - command:
or/and
and optional, if not already installed:
Code:
yum group install "Development Tools"
or
yum groupinstall "Development Tools"
or/and
Code:
yum install gcc-c++ pcre-devel zlib-devel make unzip
and optional, if not already installed:
Code:
yum install perl-XML-LibXML libxslt-devel libxslt-python perl-XML-LibXSLT gd-devel libXpm-devel perl-ExtUtils-Embed gperftools gperftools-devel
On Debian/Ubuntu - based systems, you would use the example - command:
and optional, if not already installed:
Code:
aptitude install build-essential zlib1g-dev libpcre3 libpcre3-dev unzip
and optional, if not already installed:
Code:
aptitude install libperl-dev libxml-libxml-perl libxml2-dev libxml2-utils python-libxml2 libxslt1.1 libxslt1-dev python-libxslt1 libxml-filter-xslt-perl libxml-libxslt-perl libgd-dev libgd-perl libgd-text-perl python-gd libgoogle-perftools4 libgoogle-perftools-dev
Let's start with the "step-by-step guide":
1. Please check the latest releases ( NGINX and possible modules ):
Official NGINX - download page: => nginx: download
Official ngx_pagespeed - download page: => Releases · pagespeed/ngx_pagespeed · GitHub
Official Google brotli - download page: => Releases · google/brotli · GitHub
Official ngx_cache_purge - download page: => Releases · FRiCKLE/ngx_cache_purge · GitHub
Official ngx_slowfs_cache - download page: => Releases · FRiCKLE/ngx_slowfs_cache · GitHub
Official ngx_coolkit - download page: => Releases · FRiCKLE/ngx_coolkit · GitHub
Official headers-more-nginx-module - download page: => Releases · openresty/headers-more-nginx-module · GitHub
Official ngx_pagespeed - download page: => Releases · pagespeed/ngx_pagespeed · GitHub
Official Google brotli - download page: => Releases · google/brotli · GitHub
Official ngx_cache_purge - download page: => Releases · FRiCKLE/ngx_cache_purge · GitHub
Official ngx_slowfs_cache - download page: => Releases · FRiCKLE/ngx_slowfs_cache · GitHub
Official ngx_coolkit - download page: => Releases · FRiCKLE/ngx_coolkit · GitHub
Official headers-more-nginx-module - download page: => Releases · openresty/headers-more-nginx-module · GitHub
2. Next, pls. consider to prepare your server with download folders and download the desired NGINX - version and ( possible ) modules:
Code:
mkdir -p /root/addons/nginx && cd /root/addons/nginx
Currently, the latest ( current ) NGINX - version is 1.13.6, so you would continue with:
Code:
http://nginx.org/download/nginx-1.13.6.tar.gz
tar -xvf nginx-1.13.6.tar.gz
cd /root/addons/nginx/nginx-1.13.6
... and you could now continue with the above mentioned modules - downloads:
Code:
wget https://github.com/FRiCKLE/ngx_cache_purge/archive/2.3.tar.gz
wget https://github.com/FRiCKLE/ngx_coolkit/archive/0.2.tar.gz
wget https://github.com/FRiCKLE/ngx_slowfs_cache/archive/1.10.tar.gz
wget https://github.com/openresty/headers-more-nginx-module/archive/v0.32.tar.gz
wget https://github.com/pagespeed/ngx_pagespeed/archive/v1.12.34.3-stable.tar.gz
3. We need to extract the downloaded NGINX - version and the ( possible ) modules:
4. Here is a NEW part ( implemented "Google brotli" - 01.10.2017 ):
5. Here is a NEW part ( implemented "OpenSSL 1.1.1-dev" support, so that TLSv1.3 ciphers can be used - 01.10.2017 ):
( Because I like it "tidy" on my servers, I rename files and folders sometimes )
Code:
mv 2.3.tar.gz ngx_cache_purge-2.3.tar.gz
tar -xvf ngx_cache_purge-2.3.tar.gz
mv 0.2.tar.gz ngx_coolkit-0.2.tar.gz
tar -xvf ngx_coolkit-0.2.tar.gz
mv 1.10.tar.gz ngx_slowfs_cache-1.10.tar.gz
tar -xvf ngx_slowfs_cache-1.10.tar.gz
mv v0.32.tar.gz ngx_headers-more-v0.32.tar.gz
tar -xvf ngx_headers-more-v0.32.tar.gz
mv headers-more-nginx-module-0.32 ngx_headers-more-0.32
tar -xzf v1.12.34.3-stable.tar.gz
cd ngx_pagespeed-1.12.34.3-stable
wget https://dl.google.com/dl/page-speed/psol/1.12.34.2-x64.tar.gz
tar -xzvf 1.12.34.2-x64.tar.gz
rm 1.12.34.2-x64.tar.gz
cd ..
rm *.gz
Code:
cd /usr/share/nginx/modules
git clone https://github.com/google/ngx_brotli.git
cd ngx_brotli/
git submodule update --init --recursive
Code:
cd /usr/share
git clone https://github.com/openssl/openssl.git
cd openssl
git checkout tls1.3-draft-18
./config shared enable-tls1_3 --prefix=/usr/share/openssl --openssldir=/usr/share/openssl -Wl,-rpath,'$(LIBRPATH)'
Last edited by a moderator: