Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Web Servers»Apache»How to Install Mod_Pagespeed with Apache on Ubuntu

    How to Install Mod_Pagespeed with Apache on Ubuntu

    RahulBy RahulNovember 5, 20152 Mins ReadUpdated:July 12, 2017

    The slowness of websites is a major issue faced by most of the software engineers and system administrators. They keep trying to optimize speed with various ways. Here the question is how to speed up the website? What is the best way to increase website speed? Google provides and module mod_pagespeed for Apache users which optimize your site automatically by compressing javascript and CSS files. Let’s follow the tutorial to enable Apache mod_speed module on your Debian system to speed up website performance.

    1. Install Apache2

    We are assuming that you do not have installed Apache2 on your system, But if you already have executed the following command to upgrade it to latest available version.

    $ sudo apt-get install apache2
    

    2. Install Mod_Pagespeed

    Now download the mod-pagespeed module for Apache2 from official webpage, or use the following command to download it.

    For 64bit System - 
    $ wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb
    
    For 32bit System - 
    $ wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_i386.deb
    

    After downloading above package install it using following command.

    $ dpkg -i mod-pagespeed-stable*.deb
    

    After successful installation of the package, it will prompt for restart Apache2 service to load module in the environment.

    $ sudo service apache2 restart
    

    3. Enable/Disable Mod_Pagespeed

    If you want anytime to disable or enable mod_pagespeed from apache, you don’t need to enable/disable module. Edit module configuration file /etc/apache2/mods-available/pagespeed.conf and Change following option

     ModPagespeed on      #To turn on mod_pagespeed
    
     ModPagespeed off     #To turn off mod_pagespeed
    
    

    4. Mod_Pagespeed Admin Access

    Apache Mod_Pagespeed module also provides an admin area to view statics, but default it is accessible from localhost only. To make it available from public network edit configuration file and add your IP in Allow from the list.

    <Location /pagespeed_admin>
        Order allow,deny
        Allow from localhost
        Allow from 127.0.0.1
        Allow from 12.34.567.89
        SetHandler pagespeed_admin
    </Location>
    
    <Location /pagespeed_global_admin>
        Order allow,deny
        Allow from localhost
        Allow from 127.0.0.1
        Allow from 12.34.567.89
        SetHandler pagespeed_global_admin
    </Location>
    
    

    and reload Apache2 service

    $ sudo service apache2 reload
    

    Now access /pagespeed_admin URL in your browser, You will see the page like below.

     http://example.com/pagespeed_admin/
    

    mod-pagespeed-admin

    Apache2 module pagespeed
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleFedora 23 Released! Whats New ?
    Next Article Initial Server Setup for Beginners (Ubuntu 18.04 and 16.04 LTS)

    Related Posts

    How To Disable HTTP Methods in Apache

    Updated:December 31, 20212 Mins Read

    How To Enable Brotli Compression in Apache

    2 Mins Read

    How To Install Older Version of a NPM Package

    Updated:July 4, 20212 Mins Read

    Create A Custom 404 Error Page on Apache

    Updated:April 19, 20221 Min Read

    Apache 404 Redirect to Homepage

    Updated:August 12, 20201 Min Read

    How to Enable expire headers in Apache

    Updated:May 25, 20201 Min Read

    Leave A Reply Cancel Reply

    Recent Posts
    • Filesystem Hierarchy Structure (FHS) in Linux
    • How to accept user input in Python
    • What is difference between var, let and const in JavaScript?
    • What is CPU? – Definition, Types and Parts
    • What is the /etc/aliases file
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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