How to install Mod_Pagespeed on centos

November 30, 2023 / How-to Guide

Installing Mod_Pagespeed on CentOS optimises website performance by automatically applying web performance best practices, such as caching, image optimization, and resource minification.

In this article, you will find how to install Mod_Pagespeed on CentOS.

A Brief description of mod_pagespeed:
mod_pagespeed is an open-source module for Apache which does the task of optimising the web pages and their resources. It’s an automated process and makes use of the filters for enhancement of web performance by re-writing the resources. Performance enhancement for Apache HTTP Server can easily be achieved using the module.
Multiple filters are included within this module that help in optimising JavaScript, HTML and CSS stylesheets. Moreover, even the images in the formats .jpeg and .png can be read by the filters. As a final result, users can find an improvement in the load time for webpages on a website.

How to install mod_pagespeed?

  1. Determine the Linux distros and the version on the server by using the following command:
    uname -a
  2. Download the latest version of mod_pagespeed from
     http://code.google.com/speed/page-speed/download.html

    Let’s consider a 64 bits CentOS Linux system for the procedure further

    wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_x86_64.rpm
  3. Use the following command to install it:
    rpm -i mod-pagespeed-*.rpm
  4. Confirming the installed files :
    rpm -ql mod-pagespeed-beta
    
    /etc/cron.daily/mod-pagespeed
    
    /etc/httpd/conf.d/pagespeed.conf
    
    /usr/lib64/httpd/modules/mod_pagespeed.so
    
    /var/www/mod_pagespeed/cache
    
    /var/www/mod_pagespeed/files
  5. You must now restart Apache using the below command:
    service httpd restart

How to Upgrade mod_pagespeed?
To upgrade the mod_pagespeed module, you must first download the latest version and make use of the command “yum localinstall mod-pagespeed-*.rpm” to install http://code.google.com/speed/page-speed/download.html
Use the below commands to upgrade the package:

sudo yum update
sudo /etc/init.d/httpd restart

Like this post?

Email us the shared link at: [email protected] or speak to our live chat operator now, by clicking on the “Live Chat” Scroller on the left-hand side of this page and we will provide you with the discount Coupon right away!

Spread the love