Jump to content

Install mod_pagespeed in Apache for Cpanel


Recommended Posts

[[email protected] ~]# cd /usr/src

[[email protected] src]# wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_i386.rpm

[[email protected] src]# mkdir mod-pagespeed

[[email protected] src]# cd mod-pagespeed

[[email protected] mod-pagespeed]# rpm2cpio ../mod-pagespeed-beta_current_x86_64.rpm | cpio -idmv






3135 blocks

[[email protected] mod-pagespeed]# cp ./etc/httpd/conf.d/pagespeed.conf \


[[email protected] mod-pagespeed]# cp ./usr/lib64/httpd/modules/mod_pagespeed.so \


[[email protected] mod-pagespeed]# chmod 755 /usr/local/apache/modules/mod_pagespeed.so

[[email protected] mod-pagespeed]# mkdir /var/mod_pagespeed/{cache,files} -p

[[email protected] mod-pagespeed]# chown nobody:nobody /var/mod_pagespeed/*

Mod_pagespeed needs mod_deflate to be loaded in Apache. If it is not yet installed, you can just include the same from apache source, like:

[[email protected] mod-pagespeed]# /usr/local/apache/bin/apxs -c -i \


Now, edit /usr/local/apache/conf/pagespeed.conf and change the LoadModule lines to point to these paths:

LoadModule pagespeed_module modules/mod_pagespeed.so

# Only attempt to load mod_deflate if it hasn’t been loaded already.

<IfModule !mod_deflate.c>

LoadModule deflate_module modules/mod_deflate.so

And finally, include pagespeed.conf in /usr/local/apache/conf/httpd.conf:

Include "conf/pagespeed.conf"

and then restart apache:

[[email protected] mod-pagespeed]# service httpd restart

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.


×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 最近游览

    • No registered users viewing this page.
  • {advertisement="custom-sidebar"}

  • Create New...