Mod_pagespeed is an Apache module that can be utilized to enhance the pace of Apache internet server on Linux. Mod_pagespeed has a number of filters that routinely optimize Web Pages to enhance higher efficiency. It helps a number of working programs similar to, Fedora, RHEL, Debian, Ubuntu and CentOS. Mod_pagespeed module doesn’t require modifications to current content material which means all inner optimizations and modifications to recordsdata are made on the server aspect.
On this tutorial, we are going to discover ways to set up Mod_pagespeed with Apache on Ubuntu 18.04 server.
- A server operating Ubuntu 18.04.
- A static IP deal with 192.168.0.104 is ready as much as your server
- A root password is setup to your server.
Earlier than beginning, you have to to replace your system with the most recent model. You are able to do this by operating the next command:
apt-get replace -y
apt-get improve -y
As soon as your server is up to date, restart your server to use the modifications.
Set up Apache Web Server
First, you have to to put in Apache internet server to your system. You possibly can set up it by simply operating the next command:
apt-get set up apache2 -y
As soon as the set up has been accomplished, begin Apache service and allow it to start out on boot with the next command:
systemctl begin apache2
systemctl allow apache2
After getting completed, you’ll be able to proceed to the following step.
Set up Mod_pagespeed Module
First, you have to to obtain the most recent model of Mod_pagespeed from their official web site. You are able to do it with the next command:
As soon as the obtain is accomplished, set up it by operating the next command:
dpkg -i mod-pagespeed-stable_current_amd64.deb
As soon as the set up has been accomplished efficiently, restart Apache service to use all of the modifications:
systemctl restart apache2
Now you can confirm the Mod_pagespeed module with the next command:
curl -D- localhost | head
You need to see the next output:
% Whole % Obtained % Xferd Common Pace Time Time Time Present Dload Add Whole Spent Left Pace 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0HTTP/1.1 200 OK Date: Sat, 11 Could 2019 04:58:26 GMT Server: Apache/2.4.29 (Ubuntu) Settle for-Ranges: bytes X-Mod-Pagespeed: 220.127.116.11-0 Differ: Settle for-Encoding Cache-Management: max-age=0, no-cache, s-maxage=10 Content material-Size: 10089 Content material-Sort: textual content/html; charset=UTF-8 100 10089 100 10089 0 0 182okay 0 --:--:-- --:--:-- --:--:-- 185okay
Configure Mod_pagespeed Web Interface
Mod_pagespeed module offers a easy and user-friendly internet interface to view server state. You possibly can allow Mod_pagespeed internet interface by creating /pagespeed.conf file:
nano /and so on/apache2/mods-available/pagespeed.conf
Add the next traces:
<Location /pagespeed_admin> Order enable,deny Enable from localhost Enable from 127.0.0.1 Enable from all SetHandler pagespeed_admin </Location> <Location /pagespeed_global_admin> Order enable,deny Enable from localhost Enable from 127.0.0.1 Enable from all SetHandler pagespeed_global_admin </Location>
Save and shut the file, if you end up completed. Then, restart Apache service to use all of the modifications:
systemctl restart apache2
After getting finished, you’ll be able to proceed to entry Mod_pagespeed internet interface.
Entry Mod_pagespeed Web Interface
Now, open your internet browser and kind the URL http://192.168.0.104/pagespeed_admin. You’ll be redirected to the next web page:
Message Historical past
Congratulations! you will have efficiently put in Mod_pagespeed with Apache on Ubuntu 18.04 server.
About Hitesh Jethva
Over Eight years of expertise as a Linux system administrator. My expertise embrace a depth information of Redhat/Centos, Ubuntu Nginx and Apache, Mysql, Subversion, Linux, Ubuntu, website hosting, internet server, Squid proxy, NFS, FTP, DNS, Samba, LDAP, OpenVPN, Haproxy, Amazon internet companies, WHMCS, OpenStack Cloud, Postfix Mail Server, Safety and so on.