Install Google Mod_Pagespeed on RHEL, CentOS and Fedora

mod_pagespeed is an open source module for Apache web server that automatically optimize Web Pages to improve better performance while serving web pages using Apache HTTP Server. It has several filters that automatically optimize files like HTML, CSS, JavaScript, JPEG, PNG and other resources.

As I discussed above that we are using Google‘s repository to install it for future updates, so let’s add the repository to your systems based on your OS architecture.

Step 1: Enabling Google’s mod_pagespeed Repository

Create a file called /etc/yum.repos.d/mod-pagespeed.repo with the help of your favourite editor and add the following lines of code to it based on your OS bit.

Step 4: Verifying mod_pagespeed Module for Apache

To verify mod_pagespeed module, first you need to creat a file called phpinfo.php under root directory of Apache and add the following lines of code to it. For example (/var/www/html/phpinfo.php).

Once you created the above file, then restart the Apache service to take new changes. Now access the file phpinfo.php by navigating to your web browser like http://localhost/phpinfo.php or http://IP-your-server/phpinfo.php. You will see “X-Mod-Pagespeed” section in the HTTP header, similar to below.

Install Google Mod_Pagespeed on RHEL, CentOS and Fedora

Step 5: Turning the Module On and Off

If you don’t want to use mod_pagespeed completely, you can Turn Off by editing the following line in pagespeed.conf file (in /etc/httpd/conf.d).

ModPagespeed off

Similarly, to Turn On module:

ModPagespeed on

As I said above after installing mod_pagespeed our website loads 30%-40% faster. We would really like to know about your website speed after installing it on your systems via comments.

This site is licensed under a Attribution-NonCommercial-ShareAlike 3.0 license. Feel free to change, reuse modify and extend it. Some authors will retain their copyright on certain articles. Haloseeker.com utilizes affiliate links and may receive a comission if you click an affiliate link and make a purchase.