pagespeed module goes back to default after EasyApache update on cPanel server

Alya

Registered
Jun 23, 2016
3
0
1
TLV
cPanel Access Level
Root Administrator
On cPanel server, after running update of EasyApache, pagespeed module goes back to default - meaning all changes in pagespeed.conf are been removed and looks like it overwritten with default pagespeed.conf file.
Is it possible to prevent it somehow?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

Could you let us know the specific steps you have taken to enable this module?

Thank you.
 

Alya

Registered
Jun 23, 2016
3
0
1
TLV
cPanel Access Level
Root Administrator
Hello,

Could you let us know the specific steps you have taken to enable this module?

Thank you.
I'm installing it this way:
I'm using EasyApache3.
Code:
[LIST=1]
[*]Clone the installation scripts onto your CPanel server:
[/LIST]
$> /usr/local/cpanel/3rdparty/bin/git clone https://github.com/pagespeed/cpanel.git /tmp/pagespeed/

[LIST=1]
[*]Create Speed.pm.tar.gz
[/LIST]
$> 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

[LIST=1]
[*]Login into your cPanel WHM > EasyApache and look for "mod_pagespeed" option. Alternatively, you can run the easyapache installer from command line (/scripts/easyapache). Rebuild the Apache server, reboot it, and you're good to go!
[/LIST]
Then, I just editing /usr/local/apache/conf/pagespeed.conf

Every time I update easyapche, pagespeed.conf resets to default one.
 
Last edited by a moderator:

rpvw

Well-Known Member
Jul 18, 2013
1,100
472
113
UK
cPanel Access Level
Root Administrator
I am not sure this doesn't just refer to EA4, but is this what you are looking for ?

Taken from:
Easyapache overwrites pagespeed.conf

Before you run /scripts/easyapache in the future, create these files:

vi /scripts/preeasyapache

Place the following content into the file:

#!/bin/bash
if [ -e "/usr/local/apache/conf/pagespeed.conf" ]; then
cp -prf /usr/local/apache/conf/pagespeed.conf /root/
fi

Next, create this file

vi /scripts/posteasyapache

Place the following content into the file:

if [ -e "/usr/local/apache/conf/pagespeed.conf" ]; then
mv /usr/local/apache/conf/pagespeed.conf /usr/local/apache/conf/pagespeed.conf _easy
cp -prf /root/pagespeed.conf /usr/local/apache/conf/pagespeed.conf
/etc/init.d/httpd restart
fi

The first script copies the existing pagespeed config file to /root/ at the beginning of the Apache build. The second script copies pagespeed.conf back into /usr/local/apache/conf/ folder, and restarts Apache at the end of the build.

After saving these files, ensure they can execute:

chmod +x /scripts/preeasyapache
chmod +x /scripts/posteasyapache

cPanel EasyApache Hooks: Script Hooks - EasyApache - cPanel Documentation
If you do consider EA4, you might like to see mod_pagespeed module for CPanel WHM
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
I'm happy to see the information helped. Thank you for updating this thread with the outcome.