After adding few of tutorials about PHP optimizers like Memcached, XCache and PHP eAccelerator. Which are used to optimize php scripts by caching them in compiled state. This article will help you to configure mod_pagespeed to optimize Apache server performance.
Ther are number of features availble in mod_pagespeed, Find the list of few important features:
- Automatic website and asset optimization
- Latest web optimization techniques
- 40+ configurable optimization filters
- Free, open-source, and frequently updated
- Deployed by individual sites, hosting providers, CDNs
This article will help you to how to install
Step 1 – Installation
Google Mod_pagespeed provides rpm packages to install on your CentOS systems. Use the following commands to download latest module packages on your system.
For 64-bit systems wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpmFor 32-bit systems $ wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_i386.rpm
Install the downloaded packages as well as at package on your system.
# yum install at # rpm -Uvh mod-pagespeed-*.rpm
Here is the list of module and configuration files used by mod_pagespeed.
- /etc/httpd/conf.d/pagespeed.conf : Main configuration file for Apache.
- /usr/lib/httpd/modules/mod_pagespeed.so : module for Apache.
- /var/www/mod_pagespeed/cache : Directory used to File caching
Step 2 – Configure Mod_pagespeed
By default mod_pagespeed module is enabled, If you want to change it, edit mod_pagespeed Apache configuration file and find below switch. Set this parameter on to enable this and set off to disable.
Enable mod_pagespeed add this to configuration file.
ModPagespeed on
To disable HTML rewriting but continue to serve .pagespeed. resources and parse query options.
ModPagespeed off
To completely disable mod_pagespeed use unplugged option.
ModPagespeed unplugged
After making any changes to configuration files, You need to restart the web server.
# service httpd restart
Step 3 – Verify Module
The default installation setting are fine to use mod_pagespeed module. Now create a php info file under document root of you website and add following content.
# vim /var/www/html/info.php
1 2 3 | <?php phpinfo(); ?> |
Access info.php file in the browser and search for content highlighted in below screenshot.
5 Comments
The installation went smoothly on Centos 7/64 bit. Great tutorial!
Hi, i am installed mode_pagespeed have enables in nginx config file but page speed not working. Its enabled in plesk as well. i got centos, plesk,nginx with similar setup and process i have installed it in another machine but this one is not working.
How do i check where is the problem?
iam getting ” ERRROR : Package : mod-pagespeed-beta-1.12.34.1-0.x86_64 (google-mod-pagespeed)
requires httpd => 2.2 ” but i have apache 2.4 (cpanel) so, tell me how to install mod-pagespeed on cpanel apache aerver linux 64bit.
Thank you, helped with the code
Thanks for useful information…… how can we check that pages is being served by mod_pagspeead..?