Apache 安装配置mod_pagespeed加速模块
程序员文章站
2022-06-11 12:57:47
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
上一篇: 什么原因会导致谷丙转氨酶升高,谷丙转氨酶高吃什么食物比较合适
下一篇: 徐州特产,你不可不知美食
推荐阅读
-
Windows PHP5和Apache的安装与配置
-
linux下apache、mysql、php安装配置详细笔记
-
linux 学习第十四天(Apache安装、基于ip、基于域名、基于端口配置)
-
Apache2.4.34 + php 7.28 + MySQL8.0.12 安装及配置
-
CentOS7下 Apache的安装配置方法
-
ubuntu16.10安装docker17.03.0-ce并配置国内源和加速器
-
Windows Apache2.2.11及Php5.2.9-1的安装与配置方法
-
Apache加速模块mod_pagespeed安装使用详细介绍
-
Apache防DDOS模块mod_evasive安装和配置方法详解
-
CentOS 6.4安装配置LAMP服务器(Apache+PHP5+MySQL)