MOPy 发表于 January 1, 2011 举报 Share 发表于 January 1, 2011 [[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 分享至其他网站 More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.