在apache已经编译安装好后需要加入网页gzip功能
1:下载apche源码包
2:cd 到modules/filters/目录下
3:/www/apache/bin/apxs -i -c -a mod_deflate.c 添加gzip的功能模块
4:编辑httpd.conf文件,开启gzip功能
<ifmodule mod_deflate.c>
DeflateCompressionLevel 6
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php
AddOutputFilter DEFLATE css js txt php xml html htm
</ifmodule>
5:重启httpd服务 servers httpd restart
可能会出现”module deflate_module is built-in and can’t be loaded”的报错,那是因为已经加载这个模块,重复加载了,根据提示报的行号,在httpd.conf里面找到那里注释掉就ok了
现在gzip功能就加上了