Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Web Servers»Apache»How To Configure Mod_pagespeed with Apache on CentOS & RHEL

    How To Configure Mod_pagespeed with Apache on CentOS & RHEL

    By RahulJuly 12, 20172 Mins Read

    After adding few of tutorials about PHP optimizers like Memcached, XCache and PHP eAccelerator. Which are used to optimize php scripts by caching them in compiled state. This article will help you to configure mod_pagespeed to optimize Apache server performance.

    Advertisement

    Ther are number of features availble in mod_pagespeed, Find the list of few important features:

    • Automatic website and asset optimization
    • Latest web optimization techniques
    • 40+ configurable optimization filters
    • Free, open-source, and frequently updated
    • Deployed by individual sites, hosting providers, CDNs

    This article will help you to how to install mod_pagespeed Apache module on CentOS, RHEL, and Fedora systems.

    Step 1 – Installation

    Google Mod_pagespeed provides rpm packages to install on your CentOS systems. Use the following commands to download latest module packages on your system.

    For 64-bit systems 
    wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm
    
    For 32-bit systems 
    $ wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_i386.rpm
    

    Install the downloaded packages as well as at package on your system.

    # yum install at
    # rpm -Uvh mod-pagespeed-*.rpm
    

    Here is the list of module and configuration files used by mod_pagespeed.

    • /etc/httpd/conf.d/pagespeed.conf : Main configuration file for Apache.
    • /usr/lib/httpd/modules/mod_pagespeed.so : module for Apache.
    • /var/www/mod_pagespeed/cache : Directory used to File caching
    Step 2 – Configure Mod_pagespeed

    By default mod_pagespeed module is enabled, If you want to change it, edit mod_pagespeed Apache configuration file and find below switch. Set this parameter on to enable this and set off to disable.

    Enable mod_pagespeed add this to configuration file.

    ModPagespeed on
    

    To disable HTML rewriting but continue to serve .pagespeed. resources and parse query options.

    ModPagespeed off
    

    To completely disable mod_pagespeed use unplugged option.

    ModPagespeed unplugged
    

    After making any changes to configuration files, You need to restart the web server.

    # service httpd restart
    
    Step 3 – Verify Module

    The default installation setting are fine to use mod_pagespeed module. Now create a php info file under document root of you website and add following content.

    # vim /var/www/html/info.php
    

    1
    2
    3
    <?php
      phpinfo();
    ?>

    Access info.php file in the browser and search for content highlighted in below screenshot.

    configure mod_pagespeed

    Apache module pagespeed
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    Comparing Apache MPM Worker and Prefork: Which is Right for Your Application

    An Introduction to Apache MPM (Multi-Processing Modules)

    How to Install Apache (httpd) on RHEL & CentOS Stream 9

    View 5 Comments

    5 Comments

    1. Servis racunara on January 8, 2021 10:15 am

      The installation went smoothly on Centos 7/64 bit. Great tutorial!

      Reply
    2. shamrat on December 10, 2017 5:22 pm

      Hi, i am installed mode_pagespeed have enables in nginx config file but page speed not working. Its enabled in plesk as well. i got centos, plesk,nginx with similar setup and process i have installed it in another machine but this one is not working.
      How do i check where is the problem?

      Reply
    3. Umesh on February 14, 2017 10:44 am

      iam getting ” ERRROR : Package : mod-pagespeed-beta-1.12.34.1-0.x86_64 (google-mod-pagespeed)
      requires httpd => 2.2 ” but i have apache 2.4 (cpanel) so, tell me how to install mod-pagespeed on cpanel apache aerver linux 64bit.

      Reply
    4. Maria on May 19, 2016 8:38 pm

      Thank you, helped with the code

      Reply
    5. Rajan on September 3, 2013 4:45 pm

      Thanks for useful information…… how can we check that pages is being served by mod_pagspeead..?

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • How to List Manually Installed Packages in Ubuntu & Debian
    • 10 Bash Tricks Every Developer Should Know
    • How to Validate Email Address in JavaScript
    • Firewalld: Common Firewall Rules and Commands
    • 12 Apk Commands in Alpine Linux Package Management
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.