Install Mod_pagespeed Module With Apache on Ubuntu 16.04

Introduction

Mod_pagespeed is an open source Apache module that is used to automatically optimize web pages. It makes the web faster by rewriting web pages to reduce latency and bandwidth. Mod_pagespeed also provides many optimization filters that are used to optimize various files such as css, html, png, and jpg.

In this tutorial, I will explain how to install and configure the Mod_pagespeed module with Apache on Ubuntu 16.04.

Prerequisites

  • A newly deployed Vultr Ubuntu 16.04 server instance with Apache installed.
  • A non-root user with sudo privileges setup on your server.
  • A static IP address 192.168.15.110 configure on your system.

Step 1: Update the system

Before starting, update your system to the latest stable version by running the following command:

sudo apt-get update -y
sudo apt-get upgrade -y
sudo reboot

Step 2: Install Mod_pagespeed

You can download the latest stable version of Mod_pagespeed module for Apache from it's official website. Otherwise you can download it with the following command:

wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb

Once download is complete, install it by running the following command:

sudo dpkg -i mod-pagespeed-stable_current_amd64.deb
sudo apt-get install -f

Once installation is finished, you will need to restart Apache service to load the module:

sudo systemctl restart apache2

You can verify the Mod_pagespeed module by running the following curl command:

curl -D- localhost

If everything was successful, you will see the following output:

HTTP/1.1 200 OK
Date: Mon, 28 Nov 2016 15:28:51 GMT
Server: Apache/2.4.7 (Ubuntu)
Accept-Ranges: bytes
Vary: Accept-Encoding
X-Mod-Pagespeed: 1.11.33.2-0
Cache-Control: max-age=0, no-cache
Content-Length: 10724
Content-Type: text/html; charset=UTF-8

Step 3: Configure the Mod_pagespeed module

You can configure Mod_pagespeed module different ways. Either you can use the default pagespeed.conf file to configure it for the whole server, or you can put your all of its settings in your virtual host directive.

Let's start by editing the default pagespeed.conf file:

sudo nano  /etc/apache2/mods-available/pagespeed.conf

To disable Mod_pagespeed module change the line from on to off.

ModPagespeed off

Mod_pagespeed uses different types of levels that makes configuration simple such as PassThrough, CoreFilters, and OptimizeForBandwidth. The default setting is:

ModPagespeedRewriteLevel CoreFilters

To disable CoreFilters change the lines to:

ModPagespeedRewriteLevel PassThrough

If you want to enable additional filters specify:

ModPagespeedEnableFilters filter1 filter2

To disable filter specify:

ModPagespeedDisableFilters filter1 filter2

Step 4: Access Mod_pagespeed web interface

Mod_pagespeed module provides a web based interface to view server state. You will need to add your remote machine's IP address in pagespeed.conf file to access it from a remote machine.

sudo nano /etc/apache2/mods-available/pagespeed.conf

Change the file as shown below:

<Location /pagespeed_admin>
    Order allow,deny
    Allow from localhost
    Allow from 127.0.0.1
    Allow from remote-ip-address
    SetHandler pagespeed_admin
</Location>

<Location /pagespeed_global_admin>
    Order allow,deny
    Allow from localhost
    Allow from 127.0.0.1
    Allow from remote-ip-address
    SetHandler pagespeed_global_admin
</Location>

Save the file and restart the Apache service.

sudo systemctl restart apache2

Next, open your web browser and type the URL http://192.168.15.110/pagespeed_admin to access the Mod_pagespeed web interface.

Mod_pagespeed is now installed and configured on your server.


How to Install Sylius eCommerce Platform on Ubuntu 18.04 LTS

How to Install Sylius eCommerce Platform on Ubuntu 18.04 LTS

Using a Different System? Sylius is a modern e-commerce platform for PHP, based on the Symfony Framework. Sylius source is on GitHub. This guide will wal

How to Install BookStack on Ubuntu 16.04

How to Install BookStack on Ubuntu 16.04

Using a Different System? BookStack is a simple, self-hosted, easy-to-use platform for organising and storing information. BookStack is fully free and open

How to Install Cachet on Debian 10

How to Install Cachet on Debian 10

Using a Different System? Cachet is an open-source status page system written in PHP. Cachet source code is hosted on Github. In this guide, we will go ove

How to Setup Varnish Cache 5.0 Proxy for Apache on CentOS 7

How to Setup Varnish Cache 5.0 Proxy for Apache on CentOS 7

Varnish Cache, also referred to as Varnish, is an open source caching HTTP reverse proxy which can help improve a web servers performance. In this article w

How to Install OpenMeetings on Ubuntu 16.04

How to Install OpenMeetings on Ubuntu 16.04

Using a Different System? Apache OpenMeetings is an open source web conferencing application. It is written in Java and supports multiple database servers. I

How to Install RainLoop Webmail on CentOS 7

How to Install RainLoop Webmail on CentOS 7

Using a Different System? RainLoop is a simple, modern and fast web-based email client. RainLoop source code is hosted on GitHub. This guide will show you ho

How to Install and Configure TaskBoard on Ubuntu 16.04

How to Install and Configure TaskBoard on Ubuntu 16.04

Using a Different System? Introduction TaskBoard is a free and open source tool that can be used to keep track of things that need to get done. It provides

How to Install Anchor CMS on a Debian 9 LAMP VPS

How to Install Anchor CMS on a Debian 9 LAMP VPS

Using a Different System? Anchor CMS is a super-simple and extremely lightweight, free and open source Content Management System (CMS) Blog Engine tha

How to Install OpenVAS Vulnerability Scanner on Ubuntu 16.04

How to Install OpenVAS Vulnerability Scanner on Ubuntu 16.04

Introduction OpenVAS is an open source suite that can be used for vulnerability scanning and vulnerability management. It stands for Open Vulnerabilit

Install Mod_pagespeed Module With Apache on Ubuntu 16.04

Install Mod_pagespeed Module With Apache on Ubuntu 16.04

Introduction Mod_pagespeed is an open source Apache module that is used to automatically optimize web pages. It makes the web faster by rewriting web pages t

How to Install Selfoss RSS Reader on a CentOS 7 LAMP VPS

How to Install Selfoss RSS Reader on a CentOS 7 LAMP VPS

Using a Different System? Selfoss RSS Reader is a free and open source self-hosted web-based multipurpose, live stream, mashup, news feed (RSS/Atom) reade

How to Install InvoicePlane on Ubuntu 16.04

How to Install InvoicePlane on Ubuntu 16.04

Using a Different System? InvoicePlane is a free and open source invoicing application. Its source code can be found on this Github repository. This guid

How to Install LimeSurvey CE on Debian 9

How to Install LimeSurvey CE on Debian 9

Using a Different System? LimeSurvey is an open source survey software written in PHP. LimeSurvey source code is hosted on GitHub. This guide will show yo

How to Install LimeSurvey CE on Ubuntu 18.04 LTS

How to Install LimeSurvey CE on Ubuntu 18.04 LTS

Using a Different System? LimeSurvey is an open source survey software written in PHP. LimeSurvey source code is hosted on GitHub. This guide will show yo

How to Install InvoicePlane on CentOS 7

How to Install InvoicePlane on CentOS 7

InvoicePlane is an open source e-Commerce application which can be used in to facilitate invoicing, client management, and payment tracking. This article wil

How To Install a FiveM Server on Ubuntu 19.04

How To Install a FiveM Server on Ubuntu 19.04

Prerequisites A Linux system running Ubuntu 19.04 with at least 1 CPU core and 2 GB of memory Non-root user on the system Before we begin To ensure you

How to Install BlogoText CMS on a Fedora 26 LAMP VPS

How to Install BlogoText CMS on a Fedora 26 LAMP VPS

Using a Different System? BlogoText CMS is a simple and lightweight, free and open source Content Management System (CMS) and minimalist blog engine

How to Install DreamFactory Open Source on CentOS 7

How to Install DreamFactory Open Source on CentOS 7

DreamFactory is an open source program which can turn any database into a RESTful API platform. DreamFactory can be deployed on various platforms. In thi

How to Install Anchor CMS on an Ubuntu 16.04 LAMP VPS

How to Install Anchor CMS on an Ubuntu 16.04 LAMP VPS

Using a Different System? Anchor CMS is a super-simple and extremely lightweight, free and open source Content Management System (CMS) Blog Engine tha

How to Install Hadoop in Stand-Alone Mode on CentOS 7

How to Install Hadoop in Stand-Alone Mode on CentOS 7

Apache Hadoop is an open source Big Data processing tool, widely used in the IT industry. Depending to the size, type, and scale of your data, you can deplo

Mašinų augimas: AI pritaikymas realiame pasaulyje

Mašinų augimas: AI pritaikymas realiame pasaulyje

Dirbtinis intelektas nėra ateityje, jis čia, dabartyje Šiame tinklaraštyje Skaitykite, kaip dirbtinio intelekto programos paveikė įvairius sektorius.

DDOS atakos: trumpa apžvalga

DDOS atakos: trumpa apžvalga

Ar taip pat esate DDOS atakų auka ir esate sumišęs dėl prevencijos metodų? Perskaitykite šį straipsnį, kad išspręstumėte savo užklausas.

Ar kada nors susimąstėte, kaip įsilaužėliai uždirba pinigų?

Ar kada nors susimąstėte, kaip įsilaužėliai uždirba pinigų?

Galbūt girdėjote, kad įsilaužėliai uždirba daug pinigų, bet ar kada susimąstėte, kaip jie uždirba tokius pinigus? padiskutuokime.

Revoliuciniai „Google“ išradimai, kurie palengvins jūsų gyvenimą.

Revoliuciniai „Google“ išradimai, kurie palengvins jūsų gyvenimą.

Ar norite pamatyti revoliucinius „Google“ išradimus ir kaip šie išradimai pakeitė kiekvieno žmogaus gyvenimą šiandien? Tada skaitykite tinklaraštį, kad pamatytumėte „Google“ išradimus.

Penktadienio esminiai dalykai: kas atsitiko AI varomiems automobiliams?

Penktadienio esminiai dalykai: kas atsitiko AI varomiems automobiliams?

Savavaledžių automobilių koncepcija, kuri išvažiuotų į kelius su dirbtinio intelekto pagalba, yra svajonė, kurią jau kurį laiką svajojame. Tačiau nepaisant kelių pažadų, jų niekur nematyti. Skaitykite šį tinklaraštį, kad sužinotumėte daugiau…

Technologinis išskirtinumas: tolima žmogaus civilizacijos ateitis?

Technologinis išskirtinumas: tolima žmogaus civilizacijos ateitis?

Kadangi mokslas sparčiai vystosi, perimdamas daug mūsų pastangų, taip pat didėja rizika, kad pateksime į nepaaiškinamą singuliarumą. Skaitykite, ką mums gali reikšti išskirtinumas.

Duomenų saugojimo raida – infografika

Duomenų saugojimo raida – infografika

Duomenų saugojimo metodai gali būti tobulinami nuo pat Duomenų gimimo. Šiame tinklaraštyje, remiantis infografika, aprašoma duomenų saugojimo raida.

Didžiųjų duomenų atskaitos architektūros sluoksnių funkcijos

Didžiųjų duomenų atskaitos architektūros sluoksnių funkcijos

Skaitykite tinklaraštį, kad paprasčiausiai sužinotumėte apie skirtingus didžiųjų duomenų architektūros sluoksnius ir jų funkcijas.

6 nuostabūs išmaniųjų namų įrenginių privalumai

6 nuostabūs išmaniųjų namų įrenginių privalumai

Šiame skaitmeniniu būdu pagrįstame pasaulyje išmanieji namų įrenginiai tapo svarbia gyvenimo dalimi. Štai keletas nuostabių išmaniųjų namų įrenginių privalumų, kaip jie daro mūsų gyvenimą vertą gyventi ir paprastesnį.

„macOS Catalina 10.15.4“ priedo atnaujinimas kelia daugiau problemų, nei sprendžia

„macOS Catalina 10.15.4“ priedo atnaujinimas kelia daugiau problemų, nei sprendžia

Neseniai „Apple“ išleido „macOS Catalina 10.15.4“ priedą, skirtą problemoms išspręsti, tačiau atrodo, kad dėl atnaujinimo kyla daugiau problemų, dėl kurių „Mac“ įrenginiai blokuojami. Norėdami sužinoti daugiau, perskaitykite šį straipsnį