Jump to content
精冰论坛

Install mod_pagespeed in Apache for Cpanel


MOPy

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

./etc/cron.daily/mod-pagespeed

./etc/httpd/conf.d/pagespeed.conf

./usr/lib/httpd/modules/mod_pagespeed.so

./var/mod_pagespeed/cache

./var/mod_pagespeed/files

3135 blocks

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

/usr/local/apache/conf/

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

/usr/local/apache/modules/

[[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 \

/home/cpeasyapache/src/httpd-2.2.14/modules/filters/mod_deflate.c







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.

Guest
回复此主题...

×   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.

Loading...
  • 最近游览

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

×
×
  • Create New...