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)...
If you’re on a 32-bit version (less likely)...
Follow up with:
yum install at
(If you do not already have 'at' installed)
rpm -U mod-pagespeed-*.rpm
Remove the downloaded package
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.
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: