SetOutputFilter doesn"t work in <Location>s?

SetOutputFilter doesn"t work in <Location>s?

am 04.07.2006 08:06:39 von Axel-Stephane.SMORGRAV

=20
SetOutputFilter works very well, even in Location filters. There are =
lots of happy customers of this feature, using it for such things as for =
example compression of response bodies.

Are you quite sure your filter is NOT invoked? Could you possibly have =
it generate some output to stderr?

I copied your filter declarations into an Apache 2.0.54 configuration =
and was unable to reproduce the behaviour you describe. That said, the =
response was cached by the browser and when reloading the page, it =
issued a conditional request to which the server responded with a 304. =
Therefore, at first it appeared as if the filter was not invoked, but =
after forcing an unconditional request, the page was correctly updated.

Here are the relevant parts of the configuration I used:

LoadModule ext_filter_module /opt/apache2/modules/mod_ext_filter.so
Listen labelle16:80

NameVirtualHost *:80

ServerName labelle16.gsi.fr
DocumentRoot /www/apachetest/htdocs/labelle16
CustomLog /www/apachetest/logs/access16_log combined
ErrorLog /www/apachetest/logs/error16_log
LogLevel debug

ExtFilterDefine a mode=3Doutput intype=3Dtext/html =
outtype=3Dtext/html cmd=3D"/bin/sed -e s/foo/bar/g"
ExtFilterDefine b mode=3Doutput intype=3Dtext/html =
outtype=3Dtext/html cmd=3D"/bin/sed -e s/bing/boom/g"


Header set Cache-Control no-cache
SetOutputFilter a



-ascs


-----Original Message-----
From: Andy Buckley [mailto:andy.buckley@durham.ac.uk]
Sent: Thursday, June 29, 2006 3:10 PM
To: users@httpd.apache.org
Subject: [users@httpd] SetOutputFilter doesn't work in s?

Hi,

(Before I begin: I sent two messages on a similar topic to this a couple =
of weeks ago but got no reply: can someone please give me some feedback =
on whether I should report this issue as a bug or if it is my fault?)

I have a long-standing problem with getting Apache 2 output filters to =
work on a per- basis. As far as I can tell, the =
SetOutputFilter directive either doesn't work in blocks, or =
is quite unpredictable in that context. I sent a test configuration in a =
previous email but recieved no response, so I've produced a simpler =
configuration and tested it on a different system, with the same =
results. Here's the configuration fragment:


ServerAdmin webmaster@insectnation.org
DocumentRoot /www/filtertest
ServerName test.insectnation.org

#SetOutputFilter a;b


Options Indexes FollowSymLinks MultiViews ExecCGI
AllowOverride None
Order allow,deny
Allow from all
DirectoryIndex index


ExtFilterDefine a mode=3Doutput intype=3Dtext/html =
outtype=3Dtext/html cmd=3D"/bin/sed -e s/foo/bar/g"
ExtFilterDefine b mode=3Doutput intype=3Dtext/html =
outtype=3Dtext/html cmd=3D"/bin/sed -e s/bing/boom/g"

SetOutputFilter a


SetOutputFilter b
#Order deny,allow
#Deny from all



The results of using this configuration are as follows:

* The sed replacements take place neither in test.insectnation.org/a =
or test.insectnation.org/b
* If the Location /b access is denied (by uncommenting the Order and =
Deny statements), this is correctly reflected in the browser behaviour
* If the SetOutputFilter at VirtualHost level (i.e not in any =
Location blocks) is uncommented, the sed replacements both take place as =
expected

So, the problem is not the Location matching because the access denial =
works as expected: there seems to be some problem specifically with =
SetOutputFilter used on a Location basis. This is observed using Apache
2.0.55 as packaged in Ubuntu Dapper:

andy@dirac:~$ apache2 -v
Server version: Apache/2.0.55
Server built: May 29 2006 01:52:53

I've also observed the same behaviour in Scientific Linux 4.x. Can =
anyone offer any suggestions / try this config for themselves and =
comment. If it's a genuine problem then it should be reported as a bug, =
but I'm not aware of any independent confirmations. Some assistance, =
please?

Thanks!
Andy


------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server =
Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: SetOutputFilter doesn"t work in <Location>s?

am 13.07.2006 15:56:01 von Andy Buckley

Axel-Stéphane SMORGRAV wrote:
>
> SetOutputFilter works very well, even in Location filters. There are lots of happy customers of this feature, using it for such things as for example compression of response bodies.
>
> Are you quite sure your filter is NOT invoked? Could you possibly have it generate some output to stderr?
>
> I copied your filter declarations into an Apache 2.0.54 configuration and was unable to reproduce the behaviour you describe. That said, the response was cached by the browser and when reloading the page, it issued a conditional request to which the server responded with a 304. Therefore, at first it appeared as if the filter was not invoked, but after forcing an unconditional request, the page was correctly updated.
>
> Here are the relevant parts of the configuration I used:
>
> LoadModule ext_filter_module /opt/apache2/modules/mod_ext_filter.so
> Listen labelle16:80
>
> NameVirtualHost *:80
>
> ServerName labelle16.gsi.fr
> DocumentRoot /www/apachetest/htdocs/labelle16
> CustomLog /www/apachetest/logs/access16_log combined
> ErrorLog /www/apachetest/logs/error16_log
> LogLevel debug
>
> ExtFilterDefine a mode=output intype=text/html outtype=text/html cmd="/bin/sed -e s/foo/bar/g"
> ExtFilterDefine b mode=output intype=text/html outtype=text/html cmd="/bin/sed -e s/bing/boom/g"
>
>
> Header set Cache-Control no-cache
> SetOutputFilter a
>

>


Thanks for the response, and apologies for the delay in replying: I've been
away for the last week or so.

I tried with a configuration similar to yours and, yes, it works! The Header
module is a new one for me: nice to know. A bit of investigation seems to
reveal that adding another Location with a MultiViews DirectoryIndex can stop
the filter from working:


Options +MultiViews
DirectoryIndex index


Just adding "Options +MultiViews" or using e.g. "DirectoryIndex index.html"
doesn't affect the filters. Any suggestions as to what's going on here? Is this
a bug or an expected behaviour/side-effect of how content negotiation works?

Thanks again,
Andy

--
Andy Buckley: CEDAR @ IPPP, Durham
Work: www.cedar.ac.uk
www.insectnation.org

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: SetOutputFilter doesn"t work in <Location>s?

am 03.08.2006 14:20:43 von Andy Buckley

Andy Buckley wrote:
> Axel-Stéphane SMORGRAV wrote:
>>
>> SetOutputFilter works very well, even in Location filters. There are
>> lots of happy customers of this feature, using it for such things as
>> for example compression of response bodies.

> I tried with a configuration similar to yours and, yes, it works! The
> Header module is a new one for me: nice to know. A bit of investigation
> seems to reveal that adding another Location with a MultiViews
> DirectoryIndex can stop the filter from working:
>
>
> Options +MultiViews
> DirectoryIndex index
>

>
> Just adding "Options +MultiViews" or using e.g. "DirectoryIndex
> index.html" doesn't affect the filters.

After being away for a while, I got back to looking at this recently. On my
production system, which has a more complex configuration, using an explicit
DirectoryIndex doesn't solve the problem: to get output filters working by
Location I need to specify Options -MultiViews. I need to use MultiViews *and*
output filters, and this seems to be a bug that prevents simultaneous use.

Can someone confirm or deny this behaviour and recommend on whether it should
be reported to the Apache bug tracker? I've now observed it on several copies
of Apache 2.0.52 as bundled with different Linux systems, so it seems like more
than a one-off to me.

Thanks in advance for any help (again!),
Andy

--
Andy Buckley: CEDAR @ IPPP, Durham
Work: www.cedar.ac.uk
www.insectnation.org

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: SetOutputFilter doesn"t work in <Location>s?

am 07.08.2006 14:57:37 von Andy Buckley

Andy Buckley wrote:
> Andy Buckley wrote:
>> Axel-Stéphane SMORGRAV wrote:
>>>
>>> SetOutputFilter works very well, even in Location filters. There are
>>> lots of happy customers of this feature, using it for such things as
>>> for example compression of response bodies.
>
>> I tried with a configuration similar to yours and, yes, it works! The
>> Header module is a new one for me: nice to know. A bit of
>> investigation seems to reveal that adding another Location with a
>> MultiViews DirectoryIndex can stop the filter from working:

[...]

> ... to get output filters working by Location I had to specify
> Options -MultiViews. I need to use MultiViews *and* output
> filters, and this seems to be a bug that prevents simultaneous use.
>
> Can someone confirm or deny this behaviour and recommend on whether it
> should be reported to the Apache bug tracker? I've now observed it on
> several copies of Apache 2.0.52 as bundled with different Linux systems,

Hello again,

Any confirmations or denials before I post this as a bug report? I've also
confirmed it with an Ubuntu Linux system running Apache 2.0.55.

Thanks,
Andy

--
Andy Buckley: CEDAR @ IPPP, Durham
Work: www.cedar.ac.uk
www.insectnation.org

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org