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