mod_pagespeed is an open-source Apache module created by Google to help Make the Web Faster by rewriting web pages to reduce latency and bandwidth. mod_pagespeed releases are available as precompiled linux packages or as source. (See Release Notes for information about bugs fixed)
Installation
- Update system
a
pt update -y
apt upgrade -y - Install Apache
apt-get install apache2 -y
- Enable Apache Startup
systemctl start apache2
systemctl enable apache2 - Install mod_pagespeed
wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb
dpkg -i mod-pagespeed-stable_current_amd64.deb
systemctl restart apache2 - Verify mod_pagespeed is running
curl -D- localhost | head | grep pagespeed
Web Interface
mod_pagespeed has a very simple web-interface to see statistics. If you do not case, skip this step.
nano /etc/apache2/mods-available/pagespeed.conf
Add these lines to it:
<Location /ps_admin>
Order allow,deny
Allow from localhost
Allow from 127.0.0.1
Allow from all
SetHandler ps-admin
</Location>
<Location /ps_global_admin>
Order allow,deny
Allow from localhost
Allow from 127.0.0.1
Allow from all
SetHandler ps_global_admin
</Location>
After restarting apache you can go to http://<your url>/ps_admin