Jump to content


Install Google's PageSpeed On Your VPS - Posted By Chester07

How To

  • Please log in to reply
1 reply to this topic

#1 Cryo Kinesis

Cryo Kinesis

    Haphost Staff

  • Moderators
  • 128 posts
  • LocationGridania, Eorzea

Posted 05 August 2014 - 05:14 PM

Hey guys! Do you use your VPS to host a website or maybe a blog? Do you want to make it faster? Well Google has a solution for that! Google Pagespeed or mod_pagespeed is an Apache2 mod that is lightweight and very easy to install. So I am going to show you how to install it on an Ubuntu server.

Go to any directory and download this file through wget

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

If you're running 64-bit, use this:
wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_amd64.deb

Now run this command to start installation:
sudo dpkg -i mod-pagespeed*.deb

Alright! Now that's done, it will say that you must restart Apache for the changes to take place but before we restart, we're going to change something in the configuration first.
sudo nano /etc/apache2/mods-available/pagespeed.conf
You may also use your favorite text editor to do this.

Now scroll down and look for "ModPagespeedDomain" and uncomment it out and replace the current one with your domain. Then save and quit.

Ok now we can get rid of the installation file. To do so,
rm mod-pagespeed*.deb

Lastly, restart Apache...
sudo service apache2 restart

That's it! Have fun!
  • cloudfast likes this


#2 Jessika



  • Members
  • Pip
  • 1 posts

Posted 29 November 2014 - 01:42 PM



Install Google's PageSpeed On Your VPS - Jessika



One of the more recently popular modules for Apache is mod_pagespeed. It is an output filter for Apache 2.2+ that can be configured through a variety of options through configuration files or a .htaccess file. An “output filter” is a something that transforms the data before it’s sent to the client. In other words, it’s a layer between your website and what the user’s browser receives when they visit your URL.

Speed Up the Web

The goal of mod_pagespeed is to speed up your website. It does this by applying filters to a variety of files in order to reduce the number of trips the browser has to make to grab what it needs, to reduce the size of those files and to optimize the length those files are cached.


Installation is very simple. It’ll vary depending on the operating system you use. Ubuntu and Debian have packages you can download and install (or any Linux distribution that uses .DEB packages). Other Linux distributions can download the source and build from that.

If you’re on a 64-bit version (likely)...

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

If you’re on a 32-bit version (less likely)...

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

Follow up with:

yum install at

(If you do not already have 'at' installed)

rpm -U mod-pagespeed-*.rpm

Remove the downloaded package

rm mod-pagespeed-*.deb

Note: Installing from source is outside the scope of this article. You can find detailed instructions from Google here: Build Mod_Pagespeed from Source

The module enables itself automatically when installed. However, you must restart Apache for it to start working.

/etc/init.d/httpd restart

You should now have a working version of mod_pagespeed up and running on your VPS hosting. You can check this by looking at your page’s response headers. There should be a value for “X-Mod-Pagespeed” with the version number you installed.


The installation package handles a lot of configuration out-of-the-box. In fact, there are conservative defaults that are automatically enabled on Apache. Depending on the Apache version you’re running, you’ll get a different version of the module installed and enabled. If you’re running Apache 2.2, mod_pagespeed.so will be installed; Apache 2.4 users will use mod_pagespeed_ap24.so.

Note: mod_pagespeed only works with Apache 2.2 and greater. There is also a bug with Apache 2.4.1 that prevents it from working with that version. Apache 2.4.2 or greater should be used.

Additionally, configuration files have been added to your Apache installation. The primary configuration file is pagespeed.conf. This file is located at:


Also tagged with one or more of these keywords: How To

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users