PageSpeed (mod_pagespeed) is a module for Apache web server, to speed up our websites on the server. PageSpeed module will speed up your websites by applying filters to files in order to reduce the number of requests from browsers to our server. It also reduces the size of the files and for optimizing the requests the files will be cached. The only downside of PageSpeed module is that sometimes it uses much more resources on servers. Let’s discuss some of the benefits of PageSpeed modules in short:
1) Automatic website and asset optimization
2) Latest web optimization techniques
3) Free, open-source, and frequently updated
4) Deployed by individual sites, hosting providers, CDNs
The PageSpeed module needs the mod_deflate module, you can check is this module installed on your server by running following command
# apachectl -M | grep deflate
Let’s see the steps on how to install PageSpeed module on a cPanel server.
1) Login to your server via SSH as root user, and create a new yum repository on ‘/etc/yum.repos.d/’ folder by executing following commands.
# vi /etc/yum.repos.d/mod-pagespeed.repo
Add following lines there,
For 32 bit system:
[mod-pagespeed]name=mod-pagespeed
baseurl=http://dl.google.com/linux/mod-pagespeed/rpm/stable/i386
enabled=1
gpgcheck=0
For 64 bit system:
[mod-pagespeed]name=mod-pagespeed
baseurl=http://dl.google.com/linux/mod-pagespeed/rpm/stable/x86_64
enabled=1
gpgcheck=0
2) Install mod_pagespeed module by executing following commands on the server.
# yum –enablerepo=mod-pagespeed install mod-pagespeed
Once the installation completes, following files/directories will be there on the server.
/etc/cron.daily/mod-pagespeed : This will regularly check for updates and install if they are available.
/etc/httpd/conf.d/pagespeed.conf : Main configuration file
/usr/lib/httpd/modules/mod_pagespeed.so : mod_pagespeed module for Apache
/var/www/mod_pagespeed/cache : File caching directory for the websites
Please note that you would need to include this module on Apache configuration to enable this server wide.
3) To verify the mod_pagespeed module, create a php info page on any of the domains and you can see ‘X-Mod-Pagespeed’ section on the HTTP header.
4) To disable the mod_pagespeed, add the following line at the top of ‘/etc/httpd/conf.d/pagespeed.conf’ file.
ModPagespeed off
To enable it again, alter the above line as follows on pagespeed configuration file on the server.
ModPagespeed on
If you need any further assistance please contact our support department.