gzip text html,使用mod_gzip加速你的html页面

技术文章

mod_gzip是一个可以加速html页面的程序,以apache的模块方式工作,你可以在得到

确定你的apache可以使用DSO方式安装模块。

首先解压缩并把补丁复制到临时目录中

# tar zxvf mod*z -C /tmp

# cp *tch /tmp

先打补丁

# cd /tmp/mod*a

# patch 然后就可以编译了

# make APXS=/path/to/apxs

安装:

# make install APXS=/path/to/apxs

修改apache的配置文件。

# cd /path/to/apache/conf

# cp httpd.conf httpd.conf.bak

用你喜欢的文本编辑程序,修改httpd.conf

要把下面两行去掉注释

LoadModule gzip_module libexec/mod_gzip.so

AddModule mod_gzip.c

然后在结尾添加如下配置:

# MOD_GZIP configuration

mod_gzip_on Yes

mod_gzip_minimum_file_size 1002

mod_gzip_maximum_file_size 0

mod_gzip_maximum_inmem_size 60000

mod_gzip_item_include mime "application/x-httpd-php"

mod_gzip_item_include mime text/*

mod_gzip_item_include mime "httpd/unix-directory"

mod_gzip_dechunk Yes

mod_gzip_temp_dir "/tmp"

mod_gzip_keep_workfiles No

mod_gzip_item_include file ".php3$"

mod_gzip_item_include file ".php$"

mod_gzip_item_include file ".txt$"

mod_gzip_item_include file ".html$"

mod_gzip_item_include file ".shtml$"

mod_gzip_item_exclude file ".css$"

mod_gzip_item_exclude file ".js$"

#更多想用gzip压缩的文件格式....

然后就可以启动了:

# /path/to/apache/bin/apachectl restart

如果发现有错误,根据提示重新修改httpd.conf。

mod_gzip是一个可以加速html页面的程序,以apache的模块方式工作,你可以在得到

确定你的apache可以使用DSO方式安装模块。

首先解压缩并把补丁复制到临时目录中

# tar zxvf mod*z -C /tmp

# cp *tch /tmp

先打补丁

# cd /tmp/mod*a

# patch 然后就可以编译了

# make APXS=/path/to/apxs

安装:

# make install APXS=/path/to/apxs

修改apache的配置文件。

# cd /path/to/apache/conf

# cp httpd.conf httpd.conf.bak

用你喜欢的文本编辑程序,修改httpd.conf

要把下面两行去掉注释

LoadModule gzip_module libexec/mod_gzip.so

AddModule mod_gzip.c

然后在结尾添加如下配置:

# MOD_GZIP configuration

mod_gzip_on Yes

mod_gzip_minimum_file_size 1002

mod_gzip_maximum_file_size 0

mod_gzip_maximum_inmem_size 60000

mod_gzip_item_include mime "application/x-httpd-php"

mod_gzip_item_include mime text/*

mod_gzip_item_include mime "httpd/unix-directory"

mod_gzip_dechunk Yes

mod_gzip_temp_dir "/tmp"

mod_gzip_keep_workfiles No

mod_gzip_item_include file ".php3$"

mod_gzip_item_include file ".php$"

mod_gzip_item_include file ".txt$"

mod_gzip_item_include file ".html$"

mod_gzip_item_include file ".shtml$"

mod_gzip_item_exclude file ".css$"

mod_gzip_item_exclude file ".js$"

#更多想用gzip压缩的文件格式....

然后就可以启动了:

# /path/to/apache/bin/apachectl restart

如果发现有错误,根据提示重新修改httpd.conf。

技术文章

使用mod_gzip加速你的html页面使用mod_gzip加速你的html页面使用mod_gzip加速你的html页面使用mod_gzip加速你的html页面使用mod_gzip加速你的html页面使用mod_gzip加速你的html页面使用mod_gzip加速你的html页面使用mod_gzip加速你的html页面使用mod_gzip加速你的html页面使用mod_gzip加速你的html页面使用mod_gzip加速你的html页面使用mod_gzip加速你的html页面

阅读(38) | 评论(0) | 转发(0) |

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值