linux环境给apache加gzip功能

在apache已经编译安装好后需要加入网页gzip功能

1:下载apche源码包

2:cd 到modules/filters/目录下

3:/www/apache/bin/apxs -i -c -a mod_deflate.c  添加gzip的功能模块

4:编辑httpd.conf文件,开启gzip功能

<ifmodule mod_deflate.c>
DeflateCompressionLevel 6
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php
AddOutputFilter DEFLATE css js txt php xml html htm
</ifmodule>





5:重启httpd服务  servers httpd restart

可能会出现”module deflate_module is built-in and can’t be loaded”的报错,那是因为已经加载这个模块,重复加载了,根据提示报的行号,在httpd.conf里面找到那里注释掉就ok了

现在gzip功能就加上了

转载于:https://my.oschina.net/itxti/blog/185071

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值