宝塔windows面板apache开启Gzip压缩方法
时间:2023年06月14日
/来源:网络
/编辑:佚名
宝塔windows面板apache默认没有开启Gzip压缩的,宝塔windows/linux面板nginx默认都开启gzip压缩,下面介绍下宝塔windows面板apache开启Gzip压缩方法。
iis7.0开启Gzip方法参考:宝塔windows/linux面板https开启gzip压缩
iis6.0开启Gzip方法参考:iis6.0如何开启gzip网页压缩 提高浏览速度
感谢网友安好反馈问题,经检查少写一个模块导致开启后apache无法启动 2018/05/18更正
第1步
apache配置文件默认目录:D:BtSoftWebSoftapacheconf
打开httpd.conf,找到如下配置项把前面的#去除
LoadModule deflate_module modules/mod_deflate.so
LoadModule filter_module modules/mod_filter.so
LoadModule headers_module modules/mod_headers.so
如下图:

第2步
在httpd.conf配置文件最后添加如下配置:
<IfModule deflate_module>
SetOutputFilter DEFLATE
# Don’t compress images and other
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI .(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI .(?:pdf|doc)$ no-gzip dont-vary
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>
如下图:

上述操作完后重启apache服务
最后在http://tool.chinaz.com/Gzips/进行gzip压缩检查是否已经开启,只要开启gzip压缩后http,https均可以正常使用。
iis7.0开启Gzip方法参考:宝塔windows/linux面板https开启gzip压缩
iis6.0开启Gzip方法参考:iis6.0如何开启gzip网页压缩 提高浏览速度
感谢网友安好反馈问题,经检查少写一个模块导致开启后apache无法启动 2018/05/18更正
第1步
apache配置文件默认目录:D:BtSoftWebSoftapacheconf
打开httpd.conf,找到如下配置项把前面的#去除
LoadModule deflate_module modules/mod_deflate.so
LoadModule filter_module modules/mod_filter.so
LoadModule headers_module modules/mod_headers.so
如下图:

第2步
在httpd.conf配置文件最后添加如下配置:
<IfModule deflate_module>
SetOutputFilter DEFLATE
# Don’t compress images and other
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI .(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI .(?:pdf|doc)$ no-gzip dont-vary
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>
如下图:

上述操作完后重启apache服务
最后在http://tool.chinaz.com/Gzips/进行gzip压缩检查是否已经开启,只要开启gzip压缩后http,https均可以正常使用。
新闻资讯 更多
- 【建站知识】查询nginx日志状态码大于400的请求并打印整行04-03
- 【建站知识】Python中的logger和handler到底是个什么?04-03
- 【建站知识】python3拉勾网爬虫之(您操作太频繁,请稍后访问)04-03
- 【建站知识】xpath 获取meta里的keywords及description的方法04-03
- 【建站知识】python向上取整以50为界04-03
- 【建站知识】scrapy xpath遇见乱码解决04-03
- 【建站知识】scrapy爬取后中文乱码,解决word转为html 时cp1252编码问题04-03
- 【建站知识】scrapy采集—爬取中文乱码,gb2312转为utf-804-03