In our company we always use Ubuntu LTS and Debian Stable on our servers, however sometimes we go through nine circles of hell while trying to use some mainstream applications with latest patches etc on those stable versions of Linux.
When it comes to NGINX there two great repositories one for Debian (DotDeb) and one for Ubuntu (Ondrej’s PPA).
Unfortunately Ondrej’s PPA doesn’t provide ngx_mod_pagespeed, while DotDeb repo offers a patched version nginx-extras package with Google PageSpeed module, but for some reason it supports only Wheezy and Jessie Debian releases.
So in this article I will provide you with some snippets which will help you to compile latest stable version of NGINX with Google PageSpeed support and maybe some other useful modules.
First of all let’s add these APT repositories in order to download the latest version of NGINX sources.
Please note I’m using
/etc/os-release file instead of
$(lsb_release -cs) in order to accomodate some popular Docker images, where lsb_release command is not installable.
Now that you have downloaded NGINX sources you know what’s version it’s going to be, so you can head to mod_pagespeed GitHub page and pick the right release for you NGINX (1.12.xx.x for NGINX 1.12.x etc).
Now you can go back to NGINX sources in order to inject paths to Google PageSpeed and other modules (in my case it’s Dav ext).
If you did everything correctly after running the following snippet you will see nginx_x.xx.deb package being installed.
Please feel free to comment below if you need help or visit our Gitter Lobby