Nginx Mod Pagespeed how to install latest

Well for a long time i was wondering fi there is any info online how to install nginx mod pagespeed on CentOS 6/7 nginx with mod pagespeed from a rpm package.. recently I have decided to upgrade my nginx and mod pagespeed on some Cpanel servers.. and i got this to work.. of course i had to save and modify my configs.. becouse default config after installation does not include my settings and vhosts… After some time I have just tumble up on some interesting data so I wanna share .

First of all you need to add new repo if you don’t have it allready ..

CentOS7

yum install https://extras.getpagespeed.com/release-el7-latest.rpm

CentOS6

yum install https://extras.getpagespeed.com/release-el6-latest.rpm

after that you just need to install nginx…

yum install nginx nginx-module-nps

So when you finish this.. you can just add some lines to your config to enable mod pagespeed if you dont have it allready installed and you just need to upgrade your nginx page speed :

load_module modules/ngx_pagespeed.so;

And this how my nginx.conf looks like.. well part of it.. so you can see how I did this and also I have enabled memached for pagespeed also… for a better perfromance..

load_module modules/ngx_pagespeed.so;
user nobody;

no need for more workers in the proxy mode

worker_processes 32;

error_log logs/error.log info;

worker_rlimit_nofile 8192;

events {
worker_connections 2048; # increase for more busy servers

}

http {
# pagespeed configs
pagespeed on; # Enables pagespeed for each website
pagespeed MemcachedThreads 1;
pagespeed MemcachedServers “localhost:11211”;
pagespeed EnableFilters lazyload_images;
pagespeed EnableFilters rewrite_images;
pagespeed EnableFilters rewrite_css;
pagespeed EnableFilters rewrite_javascript;
pagespeed UseExperimentalJsMinifier on;
pagespeed EnableFilters convert_jpeg_to_progressive,convert_png_to_jpeg,convert_jpeg_to_webp,convert_to_webp_lossless;
pagespeed FileCachePath /var/ngx_pagespeed_cache;
pagespeed InPlaceResourceOptimization on;
pagespeed InPlaceRewriteDeadlineMs 111;
pagespeed FileCacheSizeKb 102400;
pagespeed FileCacheCleanIntervalMs 36000000;
pagespeed FileCacheInodeLimit 500000;
pagespeed DisableFilters convert_meta_tags;
pagespeed RespectVary on;

Well I guess this can save you some time.. it works awsome.