What is Mod_PageSpeed:
PageSpeed ships with a set of core filters designed to safely optimize the content of your site without affecting the look or behavior of your site. In addition, it provides a number of more advanced filters which can be turned on by the site owner to gain higher performance improvements.
PageSpeed can be deployed and customized for individual web sites, as well as being used by large hosting providers and CDNs to help their users improve performance of their sites, lower the latency of their pages, and decrease bandwidth usage.
How to Install in CWP:
1) Install missing dependencies.
sudo yum install gcc-c++ gperf make rpm-build -y
2) Install Python 2.7 as required by Chromium Depot Tools.
cd /usr/local/src wget --no-check-certificate https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz tar xf Python-2.7.6.tar.xz cd Python-2.7.6 ./configure --prefix=/usr/local make && make altinstall
3) Install git 2.0.4 as required by Chromium Depot Tools.
cd /usr/local/src wget https://www.kernel.org/pub/software/scm/git/git-2.0.4.tar.gz tar -xf git-2.0.4.tar.gz cd git-2.0.4/ ./configure make sudo make install
4) Install the Chromium Depot Tools.
mkdir -p ~/bin cd ~/bin svn co http://src.chromium.org/svn/trunk/tools/depot_tools export PATH=$PATH:~/bin/depot_tools
5) Check out mod_pagespeed and dependencies
mkdir ~/mod_pagespeed cd ~/mod_pagespeed gclient config http://modpagespeed.googlecode.com/svn/trunk/src gclient sync --force --jobs=1
6) Install Mod_PageSpeed.
cd ~/mod_pagespeed/src export SSL_CERT_DIR=/etc/pki/tls/certs make AR.host=`pwd`/build/wrappers/ar.sh AR.target=`pwd`/build/wrappers/ar.sh BUILDTYPE=Release cd install chmod +x install_apxs.sh APXS_BIN=/usr/local/apache/bin/apxs ./install_apxs.sh
6) Restart Apache.
service httpd restart
Important Paths and Permissions:
/usr/local/apache/modules/mod_pagespeed.so (root:root) /usr/local/apache/modules/mod_pagespeed_ap24.so (root:root) /usr/local/bin/pagespeed_js_minify (root:root) /usr/local/apache/conf/pagespeed.conf (root:root) /usr/local/apache/conf/pagespeed_libraries.conf (root:root) /var/cache/mod_pagespeed (nobody:nobody)
If you want to enable mod_deflate then run the commands as below:
cd /usr/local/src/cwp/httpd-2.2.27/modules/filters/ /usr/local/apache/bin/apxs -i -c mod_deflate.c
If you want to enable mod_version then run the commands as below:
cd /usr/local/src/cwp/httpd-2.2.27/modules/metadata /usr/local/apache/bin/apxs -i -c mod_version.c