apache:禁用mod_deflate – 未知的filter

我正在Fedora(14)上运行mod_pagespeed的Apache,我得到错误消息:

[error] an unknown filter was not added: DEFLATE 

很多。 我知道这是因为mod_deflate没有加载,但是这很好,我不想加载它(负载平衡器照顾gzipping等等,当web服务器上放气时,我们得到意想不到的结果)

但是我不知道它在哪里被引用,我用这个命令来查看/ etc / httpd中的所有文件

  find . -type f -exec grep -li "deflate" {} \; 

更新该命令也searchconf.d subdir – 我用类似的东西来查看所有的服务器上的.htaccess文件

  find . -type f -name ".htaccess" -exec grep -li "deflate" {} \; 

并且唯一的引用是在.conf文件中,并且它们用# (apache已经重新启动) 更新来注释掉

 # LoadModule deflate_module modules/mod_deflate.so 

我怎样才能find它被引用的地方,并删除它?

更新我试图运行a2enmoda2dismod ,但没有这样的命令。 yum install a2dismod没有find任何安装。 这些命令的名称和/etc/apache2/mods-enabled/etc/apache2/mods-enabled目录我只能在ubuntu上find,我不知道相当于fedora / fedora-installed-via-yum命令

已安装的模块列表(但由于错误是filter是未知的,我不知道我在找什么?如果mod_deflate在这个列表中,那么当然我不会得到错误?)

 Loaded Modules: core_module (static) mpm_prefork_module (static) http_module (static) so_module (static) auth_basic_module (shared) auth_digest_module (shared) authn_file_module (shared) authn_alias_module (shared) authn_anon_module (shared) authn_dbm_module (shared) authn_default_module (shared) authz_host_module (shared) authz_user_module (shared) authz_owner_module (shared) authz_groupfile_module (shared) authz_dbm_module (shared) authz_default_module (shared) ldap_module (shared) authnz_ldap_module (shared) include_module (shared) log_config_module (shared) logio_module (shared) env_module (shared) ext_filter_module (shared) mime_magic_module (shared) expires_module (shared) headers_module (shared) usertrack_module (shared) setenvif_module (shared) mime_module (shared) dav_module (shared) status_module (shared) autoindex_module (shared) info_module (shared) dav_fs_module (shared) vhost_alias_module (shared) negotiation_module (shared) dir_module (shared) actions_module (shared) speling_module (shared) userdir_module (shared) alias_module (shared) substitute_module (shared) rewrite_module (shared) proxy_module (shared) proxy_balancer_module (shared) proxy_ftp_module (shared) proxy_http_module (shared) proxy_ajp_module (shared) proxy_connect_module (shared) cache_module (shared) suexec_module (shared) disk_cache_module (shared) cgi_module (shared) version_module (shared) cband_module (shared) dnssd_module (shared) pagespeed_module (shared) perl_module (shared) php5_module (shared) python_module (shared) ssl_module (shared) 

你得到的错误信息实际上意味着你当前的apacheconfiguration需要mod-deflate来加载。 你的apache想要使用mod-deflate作为一个处理filter,一个输出filter或一个inputfilter。

查看关于filter的apache文档 。

由于您不想使用mod-deflate您已将其禁用,并且DUMP_MODULES的输出不会显示它。 您现在需要查找使用mod-deflate和取消激活它们的filter指令。 寻找关键字DEFLATE是一个好的开始,但也期待INFLATEmod-deflate也用于解压传入的响应体)。 而且,如果你没有find任何东西,甚至寻找Filter可能会有所帮助(但是你可能会得到更长的匹配列表)。 试试像这样的命令:

 grep -r Filter /etc/apache2/* find /var/www -type f -name .htaccess -exec grep Filter {} \; 

您可能还需要将其他包含的文件作为一些软件包(一些web应用程序,如phpmyadmin和其他软件)通常在不同的目录下安装apacheconfiguration指令(至less在Debian / Ubuntu软件包中是这样,Fedora无法确定)。

您也可以完全禁用filter模块( mod-filter )和mime模块( mod-mime ,它定义了Add / RemoveFilter指令),但是可能会取消激活您可能需要的其他function。

你使用的是哪个版本的Fedora?

您不仅需要查找deflate字,还需要在您的apacheconfiguration文件中查找include语句。 大多数Linux发行版都会自动将目录中的所有文件(如/etc/apache2/conf.d/到它们的apacheconfiguration中。 这可能是你的情况。

你的发行版可能包含了a2enmoda2dismod apache工具,可以帮助pipe理apache模块。 这些实用程序通常只pipe理/etc/apache2/mods-enabled目录中的链接,然后按上面所述包含这些链接。 尝试使用这些命令来pipe理您的apache使用的模块列表。

检查htaccess文件的东西

 AddOutputFilterByType DEFLATE text/plain