Mod_pagespeed currently supports Apache and Nginx. The simple installation method in Apache is as follows. After the installation is complete, it will create a new installation source in the Yum, and then update it via Yum update.
install under Centos/fedora :
#32位
wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_i386.rpm
#64位
wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm
yum install at
rpm-u mod-pagespeed-*.rpm
install under Debina/ubuntu :
#32位
wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_i386.deb
#64位
wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.deb
Dpkg-i Mod-pagespeed-*.deb
Reboot httpd:
Service httpd Restart
To see if Pagespeed is loaded:
Configure Mod_pagespeed
Tips:mod_pagespeed needs Apache to load mod_deflate (a module that compresses Web content gzip).
32-bit please perform: wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_i386.rpm 64-bit please perform: wget https:// dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm Rpm2cpio./mod-pagespeed-stable_ current_i386.rpm | CPIO-IDMV./etc/cron.daily/mod-pagespeed./etc/httpd/conf.d/pagespeed.conf./etc/httpd/conf.d/pagespeed_ libraries.conf./usr/bin/pagespeed_js_minify./usr/lib/httpd/modules/mod_pagespeed.so./usr/lib/httpd/modules/mod _pagespeed_ap24.so./var/cache/mod_pagespeed./var/log/pagespeed 27020 blocks CP./usr/lib/httpd/modules/mod_ Pagespeed.so/usr/local/apache/modules/#apache版本 >=2.4.2, with pagespeed_ap24.so chmod 0755/usr/local/apache/modules /mod_pagespeed.so vim/usr/local/apache/conf/pagespeed.conf #新建配置文件, please modify LoadModule according to your own needs pagespeed_module/usr/local
/apache/modules/mod_pagespeed.so <ifmodule pagespeed_module> modpagespeed on ModPagespeedInheritVHostConfig on Addoutputfilterbytype Mod_pagespeed_output_filter text/html ModpagespeedfilecaChepath "/var/cache/mod_pagespeed/" Modpagespeedfilecacheinodelimit 500000 Modpagespeedavoidrenamingintrospect Ivejavascript on modpagespeedenablefilters collapse_whitespace <Location/mod_pagespeed_beacon> SetHandler Mod_pagespeed_beacon </Location> <Location/mod_pagespeed_statistics> order Allow,deny allow from localhost Allow from 127.0.0.1 sethandler mod_pagespeed_statistics </Location> modpagespeedmessagebuffer Size 100000 <Location/mod_pagespeed_message> Allow from localhost Allow from 127.0.0.1 sethandler m Od_pagespeed_message </Location> </IfModule> mkdir-p/var/mod_pagespeed/chown-r Www.www/var/mod_pagespe
Ed/echo ' Include conf/pagespeed.conf ' >>/usr/local/apache/conf/httpd.conf/usr/local/apache/bin/apachectl-t
Syntax OK Service httpd restart