mod_pagespeed currently only supports Apache 2.2.
Download the latest version of mod_pagespeed (deb file) for Ubuntu system - 32bit | 64bit
To install the packages, on Debian/Ubuntu, please run (as root) the following command:
dpkg -i mod-pagespeed-*.debInstalling mod_pagespeed will add the Google repository so your system will automatically keep mod_pagespeed up to date.
apt-get -f install
After installing mod_pagespeed, it can be customized and configured by editing the Apache configuration file /etc/apache2/mods-enabled/pagespeed.conf
Open the mod_pagespeed configuration file using command:
sudo nano /etc/apache2/mods-available/pagespeed.confBelow is my configuration setting, just paste this and restart apache server and you’re good to go.
ModPagespeedEnableFilters combine_cssmod_pagespeed required a disk cache that must be configured to a directory to which httpd has write access. The default configuration file sets this to /var/mod_pagespeed/cache/. To put the cache elsewhere please edit ModPagespeedFileCachePath to the desired location. A quick glance at the Apache error log file, typically in /var/log/apache2/error.log, will indicate whether the current setting is working.
After editing the conf file, you must restart the httpd server:
sudo /etc/init.d/apache2ctl restartTurning OFF mod_pagespeed
To turn off mod_pagespeed completely, insert as the top line of pagespeed.conf and restart your apache server:
ModPagespeed offTurning ON mod_pagespeed
To turn mod_pagespeed ON, insert as the top line of pagespeed.conf and restart your apache server:
You can also download a number of system tests to check the improvement in performance.