Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Web Servers»Apache»How to Install Mod_Pagespeed with Apache on Ubuntu

    How to Install Mod_Pagespeed with Apache on Ubuntu

    By RahulJuly 12, 20172 Mins Read

    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.

    Advertisement

    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

    Related Posts

    How to Install Apache with PHP-FPM on Ubuntu 22.04

    An Introduction to Apache MPM (Multi-Processing Modules)

    How to Install OpenCV in Python

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Implementing a Linux Server Security Audit: Best Practices and Tools
    • cp Command in Linux (Copy Files Like a Pro)
    • 15 Practical Examples of dd Command in Linux
    • dd Command in Linux (Syntax, Options and Use Cases)
    • Iptables: Common Firewall Rules and Commands
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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