Chinaunix首页 | 论坛 | 博客
  • 博客访问: 381611
  • 博文数量: 89
  • 博客积分: 3176
  • 博客等级: 中校
  • 技术积分: 1205
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-15 10:08
文章分类

全部博文(89)

文章存档

2011年(17)

2010年(19)

2009年(35)

2008年(18)

分类: 系统运维

2008-12-15 13:35:27

#####################
#
#   debian方式安装
#
#####################

# a2enmod defalte
# a2enmod headers
# vim /etc/apache2/sites-available
 
         AddOutputFilterByType DEFLATE text/html text/plain text/css
         DeflateCompressionLevel 7
         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
 
 
          SetOutputFilter DEFLATE
         BrowserMatch ^Mozilla/4 gzip-only-text/html
          BrowserMatch ^Mozilla/4\.0[678] no-gzip
          BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
          SetEnvIfNoCase Request_URI /
                \.(?:gif|jpe?g|png|exe|bmp|mp3|rar|zip|swf|cab|t?gz|bz2|sit)$ no-gzip dont-vary
          SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
          Header append Vary User-Agent env=!dont-vary
 
# /etc/init.d/apache2 reload

#####################
#
#   源码方式安装
#
#####################
# {apache-bin}/apxs -i -a -c {apache-src}/modules/filters/mod_deflate.c
         
# {apache-bin}/apxs –i –a –c {apache-src}/modules/metadata/mod_headers.c
# 编辑http.conf 添加如下内容
LoadModule headers_module     modules/mod_headers.so
LoadModule deflate_module     modules/mod_deflate.so
# 编辑http.conf 添加mod_deflate内容
### 内容同上 ###
 
 
 
阅读(689) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~