centos apache开启gzip

转自http://blog.micxp.com/index.php/archives/13/

、首先得确认apache是否已经加载了mod_deflate模块。

#httpd -M

在结果中查看是否有 deflate_module (shared) 这样的一行字段,如果有说模块己加成功。如果没有需先安装加载mod_deflate模块。

2、编辑配置文件httpd.conf,增加支持gzip的文件类型,如下:

<IfModule mod_deflate.c>
DeflateCompressionLevel 9
AddOutputFilterByType DEFLATE text/html text/xml application/x-httpd-php
AddOutputFilter DEFLATE js css
</IfModule>

你可能感兴趣的:(apache,GZip)