I like to add the Google PageSpeed Module to my nginx webserver on Ubuntu.
This link gives a simple overview https://developers.google.com/speed/pagespeed/module/build_ngx_pagespeed_from_source?hl=de but it only covers the case when you install nginx from scratch.
I already have nginx installed, and when I type the following command line inside my /var/lib/nginx folder I get a "No such file" error:
./configure --add-module=$HOME/ngx_pagespeed-release-1.7.30.4-beta
Best Answer
Your best bet at this issue is to build Nginx from scratch.
Save your nginx config files before to a safe place and then do, assuming you are in Debian:
If you are in Debian :
sudo apt-get install build-essential zlib1g-dev libpcre3-dev
Just make sure you remove Nginx and get the needed libs to build Nginx from source if not in Debian.
The libs and tools are :
This next part is system independent.
Get the latest Nginx version :
Get the latest pagespeed source:
Unpack first the module :
Wget the PSOL libs inside the module dir and unpack them there:
cd back to the nginx source root dir and configure, make and make install. Make sure you change the Nginx user on the configuration stage to one that suits your needs (--user=nginx --group=nginx):
When configure stage is done :
That will get you the last Nginx version with the last pagespeed mod and libraries ready to rock.