How to install mod_pagespeed on a WHM / cPanel server
Mod_pagespeed is an effective way of speeding up the delivery of your website to your visitors. Originally released by Google it’s now maintained by an open community and you can easily deploy this to any cPanel server. we’ve created some tests as shown below to demonstrate just how much mod_pagespeed can speed up your content.
As you can see the bottom two reports on https://www.first2host.co.uk are done with mod_pagespeed removed from the server, the YSLOW rating is 77% and the PAGESPEED is 80, But when deploying mod_pagespeed to the server we see an increase to 83% and 82% respectively. The loading time now at 3.15s.

How to install mod_pagespeed using Easy Apache 4
Create the file /etc/rpm/macros.apache2 and add the following lines of code exactly as below
nano /etc/rpm/macros.apache2
%_httpd_mmn 20120211x8664
%_httpd_apxs /usr/bin/apxs
%_httpd_dir /etc/apache2
%_httpd_bindir %{_httpd_dir}/bin
%_httpd_modconfdir %{_httpd_dir}/conf.modules.d
%_httpd_confdir %{_httpd_dir}/conf.d
%_httpd_contentdir /usr/share/apache2
%_httpd_moddir /usr/lib64/apache2/modules
Next, run the following commands in order, make sure you run each command on its own
yum install rpm-build cpio ea-apache24-mod_version
wget https://github.com/pagespeed/cpanel/raw/master/EA4/ea-apache24-mod_pagespeed-latest-stable.src.rpm
rpmbuild --rebuild ea-apache24-mod_pagespeed-latest-stable.src.rpm
rpm -ivh /root/rpmbuild/RPMS/x86_64/ea-apache24-mod_pagespeed*.rpm
/etc/init.d/httpd restart
Page Speed will now be installed to your cPanel server. In the header of any web site on the server, you will now see the page speed tag.
How was this article? – How to install mod_pagespeed on a WHM / cPanel server
You might also like
More from cPanel
Create a SWAP partition on CentOS, RHEL and AlmaLinux without a reboot
SWAP is a memory type that Linux NVMe VPS Servers use to process requests. Memory will be held in SWAP …
Help fixing Error: last request failed: [AUTH] Authentication failed.
The Error: last request failed: [AUTH] Authentication failed error can be caused by a range of things. It could be …
How To Install Ioncube V11 In cPanel
How To Install Ioncube V11 In cPanel Ioncube have released V11 of the Ioncube Loaders. Ioncube protects PHP code from theft …