安装LNMPA后,如何安装gzip模块啊
安装LNMPA后,如何安装gzip模块啊,已经编译好了mod_deflate.so但是在httpd.conf里添加
LoadModule deflate_module modules/mod_deflate.so
<IfModule mod_deflate.c>
<Location />
#Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems…
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0 no-gzip
# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.59
# the above regex won’t work. You can use the following
# workaround to get the desired effect:
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html force-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# 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
# Make sure proxies don’t deliver the wrong content
Header append Vary User-Agent env=!dont-vary
#DeflateFilterNote ratio ratio_info
#LogFormat '"%v %h %l %u %t “%r" %>s %b "%{Referer}i" "%{User-Agent}i"" (%{ratio}n)' deflate
#CustomLog logs/deflate_log deflate
</Location>
</IfModule>
启动也正常,但是并没有加载这个模块,httpd -l显示没有,怎么解决啊,急。 nginx实现的,可以自行检测。 老大能否详细讲解下,nginx默认是开始gzip的啊,但是网站只要一开启就无法显示,提示无法显示您尝试查看的页面,因为它使用了无效或者不支持的压缩格式。
该如何修改呢? 发现个问题,其实默认配置完毕,这个不管程序后台是否开始,nginx都开启了gzip,用工具也能看到,但一旦程序在设置成开启gzip,那么页面就会出错,估计是再次被apache处理了。 apache没开gzip。 具体怎么弄啊,军哥给个详细的说明吧,研究了半天都不会,apache设置加载了gzip模块,但是重启后还是显示不行,不知道问题在哪啊。 nginx已经开启gzip了,apache不需要再设置
页:
[1]