<body>

kenshou

天空没有飞过的痕迹,但我已经努力飞过……

« Home | Next » | Next » | Next » | Next » | Next » | Next » | Next » | Next » | Next » | Next »

mod_gzip的安装



1.mod_gzip的下载:
http://www.gknw.net/development/apache/httpd-2.0/unix/modules/目录下面

2.编译apxs -ica mod_gzip.c

3.加入gzip的mod到http.conf中,并把gzip配置copy到文件最后
mod_gzip_on yes
mod_gzip_dechunk yes
mod_gzip_keep_workfiles No
mod_gzip_temp_dir /tmp
mod_gzip_minimum_file_size 1002
mod_gzip_maximum_file_size 0
mod_gzip_maximum_inmem_size 1000000

mod_gzip_item_include file \.htm$
mod_gzip_item_include file \.html$
mod_gzip_item_include mime text/.*
mod_gzip_item_include file \.php$
mod_gzip_item_include mime "jserv-servlet"
mod_gzip_item_include handler "jserv-servlet"
mod_gzip_item_include mime "application/x-httpd-php.*"
mod_gzip_item_include mime httpd/unix-directory

mod_gzip_item_exclude file "\.css$"
mod_gzip_item_exclude file "\.js$"
mod_gzip_item_exclude file "\.wml$"
LogFormat "%h %l %u %t \"%V %r\" %>s %b mod_gzip: %{mod_gzip_result}n In:%{mod_gzip_input_size}n Out:%{mod_gzip_output_size}n:%{mod_gzip_compression_ratio}npct." common_with_mod_gzip_info2
CustomLog /var/log/httpd/mod_gzip common_with_mod_gzip_info2

4.测试配置文件
apachectl configtest 遇到 undefined symbol: deflate 的问题,在网上搜索后

vi /usr/local/apache2/bin/apr-config
修改LDFLAGS=" " 为 LDFLAGS="-lz"
然后再apxs -ica mod_deflate.c



5.待解决问题:可惜现在还是不能用gzip呀,好像squid同后端的gzip不能很好的配合了,从日志来看squid怎么总是发的http1.0请求。下一步就是解决squid同后面apache的mod_gzip的配合

参考:http://blog.csdn.net/ak47mig/archive/2007/03/12/1527350.aspx 《 运用mod_deflate提升网络页面浏览地速度zz》

标签: , ,

leave a response