Install mod pagespeed for cPanel EA4

From Acenet Knowledgebase
Jump to: navigation, search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

How to install mod_pagespeed on a cPanel server running EasyApache 4

Enter the following command to edit a new macro file:

nano /etc/rpm/macros.apache2

Within this file, copy and paste the following 8 lines to the file, and save.

%_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 to build the apache module and add to EasyApache 4.

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

Mod_pagespeed should now be installed, and you can verify this by running EasyApache 4 and checking the apache module section for it.