@JS's Notes

Site with notes from my work.

mod_pagespeed module with Apache2 on Ubuntu 20.04

2020-07-08 System @JS

Requirements: user with root privileges or non-root user with sudo privileges and server with a minimum 4 GB of RAM.

Installation and configuration
$ sudo apt update; sudo apt upgrade -y
$ sudo apt install apache2 curl wget -y
$ sudo systemctl is-active apache2.service
$ sudo systemctl is-enabled apache2.service
$ cd ~; mkdir download; cd download
$ wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb
$ sudo dpkg -i mod-pagespeed-stable_current_amd64.deb
## verify the mod_pagespeed module installation
$ curl -D- http://localhost | head

If you want to disable the mod_pagespeed module, edit the /etc/apache2/mods-available/pagespeed.conf file and change following line:

[...]
ModPagespeed off     #To turn off mod_pagespeed
[...]

Restart the Apache service to apply the changes.

Apache mod_pagespeed module provides a web-based admin interface to view the server state. By default, it is accessible only from the localhost. You can change this by editing the /etc/apache2/mods-available/pagespeed.conf file. Open your web browser and type the URL http://ip-address/pagespeed_admin. You should see the mod_pagespeed dashboard.

Reference: mod_pagespeed.