In this article, AZDIGI will help you install mod_pagespeed into Apache on the DirectAdmin server.
A key advantage of this module is that it requires no modification of existing content or workflow, which means all internal optimizations and file changes are done on the server, showing modified files directly to users accessing the website.
II. Install mod_pagespeed into Apache on the DirectAdmin server
To install mod_pagespeed into Apache on the DirectAdmin server, we follow these 2 steps.
Step 1: SSH into your server
To install mod_pagespeed into Apache on the DirectAdmin server, we first need to SSH or access your VPS/server with
root privileges. Or at least log in to the server with a user with
sudo privileges. If you don’t know how to SSH into your VPS/Server, you can refer to the following tutorial:
After successfully SSH, we continue with step 2 to execute the commands to install mod_pagespeed into Apache.
Step 2: Commands to install mod_pagespeed into Apache on the DirectAdmin server
The commands to install mod_pagespeed into Apache on the DirectAdmin server are relatively long, I will divide them into sections for you to follow easily.
First, we will download the mod_pagespeed module and install it with the following commands:
mkdir -p /root/mod_pagespeed cd /root/mod_pagespeed wget -O mod-pagespeed-stable_current_x86_64.rpm https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm yum install cpio -y rpm2cpio mod-pagespeed-stable_current_x86_64.rpm| cpio -idmv
The following are images during the execution of these commands.
Next, we replace the necessary files with the following commands:
mv -f ./etc/httpd/conf.d/pagespeed.conf /etc/httpd/conf/extra/pagespeed.conf mv -f ./etc/httpd/conf.d/pagespeed_libraries.conf /etc/httpd/conf/extra/pagespeed_libraries.conf mv -f ./usr/bin/pagespeed_js_minify /usr/bin/pagespeed_js_minify mv -f ./usr/lib64/httpd/modules/mod_pagespeed_ap24.so /usr/lib/apache/mod_pagespeed_ap24.so mkdir -p /var/cache/mod_pagespeed mkdir -p /var/log/pagespeed
And here is the image when I run it:
Continue to replace the path
/etc/httpd/conf/extra/pagespeed.conf with the command below:
perl -pi -e 's|/usr/lib64/httpd/modules/|/usr/lib/apache/|g' /etc/httpd/conf/extra/pagespeed.conf
After running the replacement command above, we edit the file
/etc/httpd/conf/extra/httpd-includes.conf and add the following 2 lines of configuration:
Include /etc/httpd/conf/extra/pagespeed.conf Include /etc/httpd/conf/extra/pagespeed_libraries.conf
By default, this file will have no content at all.
Finally, we restarted the Apache service.
service httpd restart
So we have installed mod_pagespeed into Apache complete.
To check if the websites on this server have Mod_pagespeed enabled, we use the following command:
curl -Is tenmien.com | grep X-Mod-Pagespeed
Remember to replace
tenmien.com with a domain running on your VPS.
You will get the following result:
Here are my results:
Hopefully, this article will help websites on your DirectAdmin server significantly increase Google Page Speed score.
Wishing you success. See more useful articles about DirectAdmin at the following link:
If you need assistance, you can contact support in the ways below:
- Hotline 247: 028 730 24768 (Ext 0)
- Ticket/Email: You use the email to register for the service and send it directly to: firstname.lastname@example.org .
- Website AZDIGI: https://azdigi.com/