Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: How to install mod_pagespeed on WHM  (Read 2803 times)

0 Members and 1 Guest are viewing this topic.

vyshakhv

  • Newbie
  • *
  • Posts: 28
  • Karma: +0/-0
How to install mod_pagespeed on WHM
« on: March 24, 2018, 07:39:21 pm »
'mod_pagespeed' is a module of Apache which is nothing but plugin which is used for compressing the external code of JavaScript and CSS.  It also used to increase the page load time as it combines multiple external JavaScript files in one file so it reduces the HTTP request.

Steps to install the mod_pagespeed on EasyApache 4-

1. SSH to the server with root access and fire below commands

Code: [Select]
yum install rpm-build cpio ea-apache24-mod_version
wget https://github.com/Prajithp/cpanel/raw/master/EA4/ea-apache24-mod_pagespeed-1.9-32.11.src.rpm
rpmbuild --rebuild ea-apache24-mod_pagespeed-1.9-32.11.src.rpm
rpm -ivh /root/rpmbuild/RPMS/x86_64/ea-apache24-mod_pagespeed-1.9-32.11.x86_64.rpm
   

2. After that restart Apache  service using below command

Code: [Select]

/etc/init.d/httpd restart


3. Now you will need to clone the script in your cPanel server by below command -

Code: [Select]

/usr/local/cpanel/3rdparty/bin/git clone https://github.com/pagespeed/cpanel.git /tmp/pagespeed/


4. Now create Speed.pm.tar.gz -

Code: [Select]

cd /tmp/pagespeed/Easy
tar -zcvf Speed.pm.tar.gz pagespeed
mkdir -p /var/cpanel/easy/apache/custom_opt_mods/Cpanel/Easy
mv Speed.pm Speed.pm.tar.gz -t /var/cpanel/easy/apache/custom_opt_mods/Cpanel/Easy/
cd && rm -rf /tmp/pagespeed


5. For verifying it you can log in to WHM >> EasyApache >> Search for the mod_pagespeed option.