Install Mod_pagespeed Module on Virtualmin in Ubuntu 16.04

Reading Time: 2 minutes

If you follow along with the entire series of article for Virtualmin Installation, you probably wish to optimize your setup. What works for me is using Mod_pagespeed.

What is Mod_pagespeed?

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.

wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb
sudo dpkg -i mod-pagespeed-stable_current_amd64.deb && sudo apt-get -f install

returns:

Selecting previously unselected package mod-pagespeed-stable.
(Reading database ... 183231 files and directories currently installed.)
Preparing to unpack mod-pagespeed-stable_current_amd64.deb ...
Unpacking mod-pagespeed-stable (1.13.35.2-r0) ...
Setting up mod-pagespeed-stable (1.13.35.2-r0) ...
Enabling module pagespeed.
To activate the new configuration, you need to run:
  systemctl restart apache2
Enabling conf pagespeed_libraries.
To activate the new configuration, you need to run:
  systemctl reload apache2
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

Alternatively, you may visit a domain that is hosted on your Droplet and see the Response Headers as shown below:

image-47-1024x542 Install Mod_pagespeed Module on Virtualmin in Ubuntu 16.04

At this point, you should be all set.

Source:
Installing From Packages

Install Mod_pagespeed Module With Apache on Ubuntu 16.04

Was this post helpful?

Leave a Reply

Close Menu