Bug 10147 - Broken ExtFilterOptions DebugLevel
Summary: Broken ExtFilterOptions DebugLevel
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_ext_filter (show other bugs)
Version: 2.0.39
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Depends on:
Reported: 2002-06-22 13:42 UTC by Christoph Vogel
Modified: 2004-11-16 19:05 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Vogel 2002-06-22 13:42:14 UTC
Actually I tried to find out how to escape ExtFilterDefine commands correctly. 
I defined

ExtFilterDefine sed-replace cmd="/bin/sed s/verdana/arial/g"

as an example (the actual problem was that cmd="/bin/sed 's/verdana/arial/g'" 
doesn't work). This external filter works okay with Set/AddOutputFilter.
To debug the command I added

ExtFilterOptions DebugLevel=9

to the corresponding <Directory> context. But then the ExtFilter stops working 
and gives me

[error] couldn't find definition of filter 'sed-replace'

in my error_log and a related error is given back to UA. Nothing else has been 
changed after adding the ExtFilterOptions directive.
Comment 1 Jeff Trawick 2002-06-22 14:54:17 UTC
I wasn't able to reproduce the lost filter definition when using this configuration:

<Directory /photo>
DirectoryIndex index.cgi
Options Indexes ExecCGI
AddHandler cgi-script .cgi

SetOutputFilter sed-replace
ExtFilterOptions DebugLevel=9

ExtFilterDefine sed-replace cmd="/bin/sed 's/photos/picurs/g'"

(I didn't see any output at the client because sed got confused by the single
quotes.  When I remove the single quotes it works fine.)

Can you spot something about my testcase which is inconsistent with your
description, or can you perhaps supply a set of minimal changes to the
default httpd-std.conf which would expose the problem?

Thanks so much!

(Certainly I need to update the doc to describe quoting issues like this!!)
Comment 2 Christoph Vogel 2002-06-22 16:12:14 UTC
I did it the other way 'round and tried to reproduce your situation :)
It does work if the ExtFilterDefine and the ExtFilterOptions statement are 
located _within the same VH_.
In my configuration ExtFilterDefine is located in the main config (so I can 
reuse it otherwhere) and ExtFilterOptions + SetOutputFilter in a directory 
context within a VH. Contrarily the ExtFilter works fine in this situation if 
ExtFilterOptions is not set. So the bahaviour is inconsistent and I think one 
should have the possibility to split Define and Options for ExtFilter just like 
I did.
Apart from that - wouldn't it be nice to have a separate logfile for ExtFilters 
just like with CGIs oder URL rewriting? I dunno if it's a enough for a formal 
feature request.
Comment 3 Jeff Trawick 2002-06-24 16:45:37 UTC
Thanks for the update...  I was able to reproduce and am working on a change
to mod_ext_filter so that filter definitions can be used across multiple

(I'm ignoring your feature request for the moment :) )

Thanks again!
Comment 4 Jeff Trawick 2002-06-26 20:01:15 UTC
mod_ext_filter has been changed to find filter definitions in the main
server in case they weren't defined in the vhost...  the patch as committed
is below, and will be in the next release of Apache:


I tweaked the documentation to try to clarify how parameters to the
external program are specified.  In addition, I added a new example
which you might recognize.

If you really want to have stderr from the filter written to a file,
please write another PR for the feature request.  I don't personally
plan on doing anything about that unless it is clear that there is
a widespread desire for it.  (Other folks may be interested however.)
Note that the LogStderr option (on the ExtFilterOptions directive) can 
be used to capture the external filter's stderr in the Apache error log.

Thanks again for your report!