Articles & Code Snippets


Install mod_pagespeed on EasyApache4

How to install google mod_pagespeed on EasyApache4 - WHM/Cpanel


Installation Procedure (CentOS):


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
service httpd restart  

If you get following error on line 3


"RPM build errors:
File must begin with "/": %{_httpd_moddir}/*.so
File must begin with "/": %{_httpd_modconfdir}/*.conf"

Create a file "macros.apache2" under '/etc/rpm/' directory and paste the below content, then go back to installation from line 3


%_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

Now Login to your WHM panel > Software > EasyApache4 and look for "mod_pagespeed" option and enable it after that restart apache again and run insight then check your website speed performance!

web


Archives