最新消息:

Google 加速模块mod-pagespeed安装

google admin 2951浏览 0评论

一、安装环境:CentOS 5.3安装Google mod-pagespeed 模块

Google webmaster central blog last week announced new module mod_pagespeed for Apache web servers which makes the site to load very fast and still this module in beta stage.

Previously Google webmaster central came with a tool Page speed extension for Firefox, which calculates and analyzes the web page and returns which makes element or external file makes more slowness in your web page.

What is mod_pagespeed ?
mod_pagespeed is an open-source Apache module that automatically optimizes web pages and resources for better performance. mod_pagespeed includes several filter that optimize JavaScript, HTML and CSS stylesheets. It also includes filters for optimizing JPEG and PNG images.

mod_pagespeed module comes for different Linux distributions like Debian/Ubuntu and CentOS/Fedora and also for 32 bit and 64 bit distributions

如果你在安装的时候出现yum localinstall -y mod-pagespeed-beta_current_i386.rpm

Public key for mod-pagespeed-beta_current_i386.rpm is not installed

则需要导入Google Public key:

wget https://dl-ssl.google.com/linux/linux_signing_key.pub
rpm –import linux_signing_key.pub

或者

rpm –import http://dl.google.com/linux/linux_signing_key.pub

OK,现在开始安装mod-pagespeed

模块下载地址:http://code.google.com/intl/zh-cn/speed/page-speed/download.html

测试安装环境CentOS 5.5 32bit,请根据需求从模块下载地址获取正确模块:

wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_i386.rpm
yum localinstall -y mod-pagespeed-beta_current_i386.rpm

mod_pagespeed 可以在 Web Server 輸出內容前即時優化, 再輸出.
目前官方有提供 CentOS/Fedora、Debian/Ubuntu (32-bit and 64-bit) 的套件
在 CentOS 5.5 下安裝很順利, 只要將 rpm 安裝, 重啟 Apache 即可.

若是自己编的 Apache, configure 时需加上 –enable-deflate 参数, 装完 rpm 后,
若 Apache 的路径在 /usr/local/apache
mv /usr/lib/httpd/modules/mod_pagespeed.so /usr/local/apache/modules
httpd.conf 加入 LoadModule pagespeed_module modules/mod_pagespeed.so
再把 /etc/httpd/conf.d/pagespeed.conf 里面的 IfModule pagespeed_module 区段复制到 httpd.conf

要确认 mod_pagespeed 是否有运作, 可以查看 phpinfo(); 页面,
在 HTTP Headers Information 可以看到 X-Mod-Pagespeed 0.9.0.0-128

至于mod-pagespeed模块的作用如下:

不需要对网站 CMS 系统进行改变即可应用。
加速模块可以自行对网络传输的 html 字节优化及对图象 、css 进入压缩优化传输
智能缓存是一大亮点,它可以自动智能缓存,加速下载
目前这套优化模块已经应用GoDaddy服务器上,而且反响良好。根据此前的一些实践来看, 通过mod_pagespeed可以对 Web 性能的多个方面,包括缓存、客户端与服务器之间的连接、载荷大小等进行优化,最大可将页面加载时间缩短 50% 。

项目主页: http://code.google.com/speed/page-speed/docs/module.html
插件下载地址: http://code.google.com/speed/page-speed/download.html
开源项目地址: http://code.google.com/p/modpagespeed/

转载请注明:爱开源 » Google 加速模块mod-pagespeed安装

您必须 登录 才能发表评论!