VPS侦探论坛

 找回密码
 注册
查看: 8667|回复: 6

安装LNMPA后,如何安装gzip模块啊

[复制链接]
发表于 2011-6-26 02:44:39 | 显示全部楼层 |阅读模式

安装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[678] 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显示没有,怎么解决啊,急。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-6-26 09:46:44 | 显示全部楼层


nginx实现的,可以自行检测。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2011-6-26 10:45:26 | 显示全部楼层

老大能否详细讲解下,nginx默认是开始gzip的啊,但是网站只要一开启就无法显示,提示无法显示您尝试查看的页面,因为它使用了无效或者不支持的压缩格式。

该如何修改呢?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2011-6-26 11:09:33 | 显示全部楼层



发现个问题,其实默认配置完毕,这个不管程序后台是否开始,nginx都开启了gzip,用工具也能看到,但一旦程序在设置成开启gzip,那么页面就会出错,估计是再次被apache处理了。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2011-6-26 12:59:09 | 显示全部楼层

apache没开gzip。

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2011-6-28 16:22:51 | 显示全部楼层

具体怎么弄啊,军哥给个详细的说明吧,研究了半天都不会,apache设置加载了gzip模块,但是重启后还是显示不行,不知道问题在哪啊。
发表于 2011-6-28 19:33:16 | 显示全部楼层

nginx已经开启gzip了,apache不需要再设置
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-20 20:44 , Processed in 0.027397 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表