1. Home
  2. Help Articles
  3. Installing mod_pagespeed with Apache on Ubuntu/CentOS

Installing mod_pagespeed with Apache on Ubuntu/CentOS

Introduction

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.

Prerequisites

  • 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

Ubuntu:

# sudo apt-get update
# sudo apt-get upgrade

CentOS:

# sudo yum update
# sudo yum upgrade

Download mod_pagespeed

Now let’s move on to downloading the mod_pagespeed package (64-bit) for Apache by running the following command,

Ubuntu:

# wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb

CentOS:

# wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm

Install mod_pagespeed

Having downloaded the package, you can install it using the command below

Ubuntu:

# dpkg -i mod-pagespeed-stable_current_amd64.deb
# sudo apt-get install -f

CentOS:

# 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.

Ubuntu:

# service apache2 restart.

CentOS:

# /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: 1.11.33.5-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.

 

Updated on February 3, 2017

Was this article helpful?

Related Articles

Add A Comment