安装Google 模块mod-pagespeed 加速apache

         安装Google 模块mod-pagespeed 加速apache

一、安装环境: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免费模块用于优化Apache HTTP服务器框架下的网站速度。该模块从多个方面对服务器运行速度进行优化,例如可以对图片进行再压缩,通过CMS(内容管理系统)改变网页构造但不改变CMS本身等。在此次开源之前,Google内部也一直使用该模块。

更详细的mod-pagespeed模块优化见:http://www.modpagespeed.com/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值