Speed-up NGINX using ngx_pagespeed on a CentOS 6 VPS

The following article will guide you through the steps of compiling and installing Nginx and ngx_pagespeed module on your Linux VPS

Using ngx_pagespeed you can significantly speed-up your websites without needing to tune or change your web-applications.

How is this possible?

ngx_pagespeed runs as a module inside Nginx and rewrites your webpages to make them faster. The rewrite includes minifying CSS and JS (JavaScript), extending cache lifetimes, compressing images and many other web performance best practices.

UPDATE THE SYSTEM

Before proceeding any further, make sure you are in a screen session and check if your CentOS 6 VPS is fully up-to-date by running:

## screen -U -S pagespeed-screen
## yum update

INSTALL DEPENDENCIES

Since we are going to compile Nginx and ngx_pagespeed from source, we need to install some required packages on the system using yum

Of course you don’t have to do any of this if you use one of our Optimized CentOS Web Hosting services, in which case you can simply ask our expert linux admins to install this for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

Perfect tutorial. I’m on CentOS 7 and everything went excellent until the “service nginx restart”. When I did that, I received a FAILED error and the suggestion to put “systemctl status nginx.service” and a “journalctl -xn” to see more regard the problem.