一.安装模块

   1.apache编译时就设置了defalte.

    --enable-defalte

    查看是否有安装过

    bin/apachectl -l|grep defalte

   2.编译时没有增加,需要动态添加

    /bin/apxs -i -a -c mod_deflate.c

二.http.conf增加配置参数

   <IfModule mod_deflate.c>
        DeflateCompressionLevel 9
        SetOutputFilter DEFLATE
        AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-javascript application/x-httpd-php
  </IfModule>