免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2054 | 回复: 1
打印 上一主题 下一主题

使用mod_gzip加速你的html页面 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-12-12 14:48 |只看该作者 |倒序浏览
mod_gzip是一个可以加速html页面的程序,以apache的模块方式工作 确定你的apache可以使用DSO方式安装模块。首先解压缩并把补丁复制到临时目录中 # tar zxvf mod*z -C /tmp # cp *tch /tmp 先打补丁 # cd /tmp/mod*a # patch <../mod_gzip_debug.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。

论坛徽章:
0
2 [报告]
发表于 2008-12-12 16:50 |只看该作者
lz是个培训机构吧。
看你这胡乱转帖的样子,我很怀疑你们的培训效果啊。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP