您的位置主页 > 系统管理

mod_deflat for apache

a. 新安装 apache 加上 --enable-deflate

加装执行 /usr/local/apache/bin/apxs -i -a -c /usr/local/src/httpd/filters/mod_deflate.c

b. 安装完毕 查看是否添加 LoadModule deflate_module modules/mod_deflate.so

c. 编辑 httpd.conf


<ifmodule mod_deflate.c>
DeflateCompressionLevel 9
SetOutputFilter DEFLATE
#DeflateFilterNote Input instream
#DeflateFilterNote Output outstream
#DeflateFilterNote Ratio ratio
#LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
#CustomLog logs/deflate_log.log deflate
</ifmodule>


d. 官方参考: http://httpd.apache.org/docs/2.0/mod/mod_deflate.html