Google Pagespeed is a family of tools by Google which is designed to help a website’s performance optimizations. This article will briefly explain how to install mod_pagespeed package from google on an Ubuntu/CentOS server running apache.
- Ubuntu/CentOS server with apache web server installed over it.
- User account with sudo privileges.
Update Linux OS
Before downloading the package, make sure that Ubuntu/CentOS is updated and upgraded. To do this run the below commands in succession
# sudo apt-get update # sudo apt-get upgrade
# sudo yum update # sudo yum upgrade
Now let’s move on to downloading the mod_pagespeed package (64-bit) for Apache by running the following command,
# wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb
# wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm
Having downloaded the package, you can install it using the command below
# dpkg -i mod-pagespeed-stable_current_amd64.deb # sudo apt-get install -f
# yum install at # rpm -U mod-pagespeed-*.rpm
After installing the mod_pagespeed module successfully, you will need to restart apache to load the module.
# service apache2 restart.
# /etc/init.d/httpd restart
Verify the installation
You can verify the status of mod_pagespeed module by running the command in the terminal
curl -D- localhost | less
If everything is running fine, you shall see an output similar as the following,
Date: Fri, 03 Feb 2017 05:49:23 GMT Server: Apache/2.4.7 (Ubuntu) Accept-Ranges: bytes Vary: Accept-Encoding X-Mod-Pagespeed: 220.127.116.11-0 Cache-Control: max-age=0, no-cache Content-Length: 10724
You should now have mod_pagespeed up and running on your server.
You can check out this article if you want to turn pagespeed ON/OFF on apache web server.