Install mod_pagespeed to Improve Apache Performance on CentOS/RHEL & Fedora

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. It support around 45 famous & most useful PageSpeed filters wihch 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 RHEL/CentOS/Fedora

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 & Install mod_pagespeed 64-bit package]
# rpm -Uvh

[Download & Install mod_pagespeed 32-bit package]
# rpm -Uvh

[Install at command, if its not installed]
# yum install at

[It will automatically create the mod_pagespeed repo]
# cat /etc/yum.repos.d/mod-pagespeed.repo

Note the mod_pagespeed files location for future usage.

[mod_pagespeed Config files

[mod_pagespeed module for Apache 2.4

[mod_pagespeed module for Apache 2.2

[mod_pagespeed cron file

Change/Modify below File permission to 755.

[Change the file permission for Apache 2.4
# chmod 755 /etc/httpd/modules/

[Change the file permission for Apache 2.2
# chmod 755 /etc/httpd/modules/

Restart Apache Web Server to take effect the changes.

[Restart Apache webserver on SysVinit systems]
# service httpd restart

[Restart Apache webserver on SysVinit systems]
# systemctl restart httpd.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: Sat, 05 Mar 2016 15:09:53 GMT
Server: Apache/2.4.18 (Fedora) PHP/5.6.17
Accept-Ranges: bytes
Cache-Control: max-age=0, no-cache
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]
# nano /etc/httpd/conf.d/pagespeed.conf
ModPagespeed on

[Disable pagespeed]
ModPagespeed off

Keep smile..because your website is now 30-40% speed compare with earler…cool)

Vinoth Kumar

Vinoth Kumar has 3.5+ years of experience in Linux server administration & RHEL certified professional. He is currently working as a Senior L2 Linux Server administrator.

You may also like...

Please support the site
By clicking any of these buttons you help our site to get better