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.

Lets begin to how to install mod_pagespeed in our cPanel Server.

  • Create file /etc/rpm/macros.apache2 and add the following lines of code exactly as below[code]
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
  • Run the following commands in order, make sure you run each command on its own
yum install rpm-build cpio ea-apache24-mod_version
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

Thats all, you can verify your mod_pagespeed in this Website Tools.