How to Install Mod_Pagespeed on Centos ?
A Brief about mod_pagespeed ?
mod_pagespeed is an open-source module for Apache which does the task of optimizing the web pages and its resources. Its an automated process and makes use of the filters for enhancement of web performance by rewriting the resources. Performance enhancement for Apache HTTP Server can be
easily achieved using the module.
Multiple filters are enclosed within this module that needs in optimizing JavaScript, HTML and CSS stylesheets. Moreover, even the pictures in the formats .jpeg and .png can be read by the filters. As a result, users will find an improvement in the load time for web pages on a web site.
How to install mod_pagespeed?
Step1 : Determine the Linux distros and the version on the server by using the following command:
uname -a
Step 2 : Download the latest version of mod_pagespeed from http://code.google.com/speed/page-speed/download.html
Lets consider a 64 bits CentOS Linux system for the procedure further
wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_x86_64.rpm
Step 3 : Use the following command to install it:
rpm -i mod-pagespeed-*.rpm
Step 4 : Confirming the installed files :
rpm -ql mod-pagespeed-beta
/etc/cron.daily/mod-pagespeed
/etc/httpd/conf.d/pagespeed.conf
/usr/lib64/httpd/modules/mod_pagespeed.so
/var/www/mod_pagespeed/cache
/var/www/mod_pagespeed/files
Step 5 : You must now restart Apache using the below command
service httpd restart
How to Upgrade mod_pagespeed ?
To upgrade the mod_pagespeed module, you will have to first download the latest version and use of the command “yum localinstall mod-pagespeed-*.rpm” for the purpose of installing http://code.google.com/speed/page-speed/download.html
Below is the commands to upgrade the package :
sudo yum update
sudo /etc/init.d/httpd restart