Apache 安装配置mod_pagespeed加速模块
程序员文章站
2024-02-06 20:42:58
mod_pagespeed目前支持apache和nginx。apache中简单的安装方法如下。安装完成之后,它会在yum里新建一个安装源,之后通过yum update更新就...
mod_pagespeed目前支持apache和nginx。apache中简单的安装方法如下。安装完成之后,它会在yum里新建一个安装源,之后通过yum update更新就可以了
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
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
重启httpd:
service httpd restart
查看pagespeed是否加载:
httpd -m|grep pagespeed
配置mod_pagespeed
tips:mod_pagespeed 需要 apache 加载 mod_deflate(一个将 web内容gzip压缩后传输的模块)。
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 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,用pagespeed_ap24.so chmod 0755 /usr/local/apache/modules/mod_pagespeed.so vim /usr/local/apache/conf/pagespeed.conf #新建配置文件,请根据自己需求修改 loadmodule 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 modpagespeedavoidrenamingintrospectivejavascript 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> modpagespeedmessagebuffersize 100000 <location /mod_pagespeed_message> allow from localhost allow from 127.0.0.1 sethandler mod_pagespeed_message </location> </ifmodule> mkdir -p /var/mod_pagespeed/ chown -r www.www /var/mod_pagespeed/ echo 'include conf/pagespeed.conf' >> /usr/local/apache/conf/httpd.conf /usr/local/apache/bin/apachectl -t syntax ok service httpd restart
上一篇: Python 实现某个功能每隔一段时间被执行一次的功能方法
下一篇: Python学习手册之类和继承
推荐阅读
-
Apache 安装配置mod_pagespeed加速模块
-
Apache1.3.x+PHP4 Beta3在Windows 9x/NT下的安装与配置_PHP教程
-
Linux下PHP加速器APC的安装与配置笔记,加速器apc_PHP教程
-
Apache1.3.x + PHP4 Beta3在Windows 9x/NT下的安装与配置_PHP
-
安装apache2.2.22配置php5.4(具体操作步骤)
-
apache配置加载的模块,重启后却不能加载,但其他集成环境却可以
-
程序员 - 为什么我把Apache和PHP都安装到了D磁盘,在phpinfo()里面却发现配置文件在c:windows 里面
-
CentOS7服务器中apache、php7以及mysql5.7的安装配置代码
-
linux - 安装mod_php5模块, 实现apache对php的支持, 这个东西怎么理解??
-
Linux下Apache安装/增加mod_rewrite模块的方法