web analytics

Install Pagespeed in cpanel server

Version Installed :




Pagespeed requires deflate module, so that should be compiled already with 


Once deflate is enabled, do the following.


  1. cd /usr/local/src

  2. Check if the server is 32 bit or 64 bit and then download the corresponding pagespeed rpm. You can check it by issuing any of the following commands.


uname –m




getconf LONG_BIT


  1. mkdir mod-pagespeed

  2. cd mod-pagespeed

  3. rpm2cpio ../mod-pagespeed-beta_current_x86_64.rpm | cpio –idmv

  4. cp etc/httpd/conf.d/pagespeed.conf /usr/local/apache/conf/

  5. cp usr/lib64/httpd/modules/mod_pagespeed.so /usr/local/apache/modules/

  6. chmod 755 /usr/local/apache/modules/mod_pagespeed.so

  7. mkdir /var/mod_pagespeed/{cache,files} –p

  8. chown nobody:nobody /var/mod_pagespeed/*

  9. Now we need to edit pagespeed.conf to reflect the changes in paths. Before that take a copy of the default pagespeed.conf so that we can revert it any time.


cp -pv /usr/local/apache/conf/pagespeed.conf /usr/local/apache/conf/pagespeed.conf.default


  1. vi /usr/local/apache/conf/pagespeed.conf


Modify the lines given below as follows.


LoadModule pagespeed_module /usr/local/apache/modules/mod_pagespeed.so


LoadModule deflate_module /usr/local/apache/modules/mod_deflate.so


ModPagespeedFileCachePath “/var/mod_pagespeed/cache/”


ModPagespeedGeneratedFilePrefix “/var/mod_pagespeed/files/”


  1. Save and quit the file. Now we need to include this conf in apache, but being a cpanel server, direct apache conf edits may be rewritten later. So do it as follows.


vi /usr/local/apache/conf/includes/pre_main_global.conf


Add the following line and save the file.


Include “/usr/local/apache/conf/pagespeed.conf”


Now run the apache distiller


/usr/local/cpanel/bin/apache_conf_distiller -–update




/etc/rc.d/init.d/httpd restart

One comment to Install Pagespeed in cpanel server

  • Forrest  says:

    I’m not sure where you’re getting your info, but good topic.
    I needs to spend some time learning much more
    or understanding more. Thanks for great info I was looking for this information for my mission.

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>