Install mod_pagespeed to Improve Apache Performance on Ubuntu & Debian

mod_pagespeed is an open-source Apache & Nginx Web Server module created by Google to help Make the Web Faster by rewriting web pages to reduce latency and bandwidth. It has several filters that automatically optimize files like HTML, CSS, JavaScript, JPEG, PNG and other resources to speedup your website 30-40% compare with earlier stage. Alternatively you can read mod_pagespeed installation on RPM systems such as CentOS, RHEL & Fedora .It support around 45 famous & most useful PageSpeed filters which will used to optimize your apache performance such a different aspect & parameter. The latest version of Pagespeed released on February 03, 2016 with Security update, Still pagespeed team working hard to improve the performance.

1) Download & Install pagespeed module on Ubuntu, Mint & Debian

Before proceeding mod_pagespeed module, make sure you should install Apache Web Server on your environment. Follow the below steps to install mod_pagespeed module on your apache server.

[Download mod_pagespeed 64-bit package]
$ wget

[Download mod_pagespeed 32-bit package]
$ wget

[Install at command, if its not installed]
$ sudo apt-get install at

[Install Install mod_pagespeed module]
$ sudo dpkg -i mod-pagespeed-stable_current_amd64.deb

[It will automatically create the mod_pagespeed repo]
# cat /etc/apt/sources.list.d/mod-pagespeed.list
deb stable main

Note the mod_pagespeed files location for future usage.

[mod_pagespeed Config files]

[only for Debian]

[mod_pagespeed Apache 2.4 file

[mod_pagespeed Apache 2.2 file

[mod_pagespeed cron file

Change/Modify File permission 755 if no. Otherwise leave as it is.

[Change the file permission for Apache 2.4
$ sudo chmod 755 /usr/lib/apache2/modules/

[Change the file permission for Apache 2.2
$ sudo chmod 755 /usr/lib/apache2/modules/

Restart Apache Web Server to take effect the changes.

[Restart Apache webserver on SysVinit systems]
$ sudo service apache2 restart

[Restart Apache webserver on SysVinit systems]
$ sudo systemctl restart apache2.service

2) Verify pagespeed is running with apache

Just create the phpinfo file and verify it in browser whether pagespeed is running or not. Alternatively we can check in terminal whether mod pagespeed working with apache or not. See below I have running latest stable release of pagespeed (

$ curl -I localhost
HTTP/1.1 200 OK
Date: Tue, 23 Feb 2016 07:02:12 GMT
Server: Apache/2.4.10 (Debian)
Accept-Ranges: bytes
Vary: Accept-Encoding
Cache-Control: max-age=0, no-cache
Content-Length: 11087
Content-Type: text/html; charset=UTF-8

3) Enable/Disable the module

By default pagespeed module is enabled on Apache after installation. If you want to disable, you can do by editing the pagespeed.conf file.

[Enable pagespeed]
$ sudo nano /etc/apache2/mods-available/pagespeed.conf
ModPagespeed on

[Disable pagespeed]
ModPagespeed off

We can access the Mod_Pagespeed admin page too.
Graphs trend.
Keep smile..because your website is now 30-40% speed compare with earlier…cool)

About Magesh Maruthamuthu

Love to play with all Linux distribution

View all posts by Magesh Maruthamuthu

Leave a Reply

Your email address will not be published. Required fields are marked *