You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jimmy McDonald <io...@bsdshell.dyndns.org> on 2003/04/30 01:35:26 UTC

[users@httpd] complex question

How would I go about implementing a script
that the apache server executes on everything
it passes to the browser so that it scans
for certain patterns and rewrites them before
the browser gets them?

I am thinking something with a

RewriteMap foo prg:foo.pl

I'm not sure how to write the Rule though.



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] complex question

Posted by Joshua Slive <jo...@slive.ca>.
On Tue, 29 Apr 2003, Jimmy McDonald wrote:

> How would I go about implementing a script
> that the apache server executes on everything
> it passes to the browser so that it scans
> for certain patterns and rewrites them before
> the browser gets them?
>
> I am thinking something with a
>
> RewriteMap foo prg:foo.pl
>
> I'm not sure how to write the Rule though.

No, mod_rewrite deals only with urls, not content.  The answer is
essentially the same as the answer to this question:
http://httpd.apache.org/docs/misc/FAQ.html#footer
Although, if you are using 2.0, you can also see mod_ext_filter as another
option.

If you are handling any serious amount of requests, however, you will want
to do this as an apache module, rather than a cgi script or ext_filter
program.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] complex question

Posted by Rich Bowen <rb...@rcbowen.com>.
On Tue, 29 Apr 2003, Jimmy McDonald wrote:

> How would I go about implementing a script
> that the apache server executes on everything
> it passes to the browser so that it scans
> for certain patterns and rewrites them before
> the browser gets them?
>
> I am thinking something with a
>
> RewriteMap foo prg:foo.pl
>
> I'm not sure how to write the Rule though.

While, as mentioned, mod_ext_filter is the way to do this on Apache 2.0,
if you are using Apache 1.3, you probably want the Action directive,
which will run a cgi program for you whenever a document of a particular
type is requested. Your cgi can then process the file before it is sent
to the browser. This is very inefficient, but may accomplish what you
are trying to do. Perhaps see also Script.

http://httpd.apache.org/docs/mod/mod_actions.html#action
http://httpd.apache.org/docs/mod/mod_actions.html#script

-- 
Rich Bowen - rbowen@rcbowen.com
... and another brother out of his mind, and another brother out at New
York (not the same, though it might appear so)
	Somebody's Luggage (Charles Dickens)

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] complex question

Posted by Jimmy McDonald <io...@bsdshell.dyndns.org>.
Joshua and Andre,

Thanks both for setting me straight.

Off to read the docs!

Already have apache 2 :)




On Wed, 30 Apr 2003, [ISO-8859-1] André Malo wrote:

> * Jimmy McDonald wrote:
>
> > How would I go about implementing a script
> > that the apache server executes on everything
> > it passes to the browser so that it scans
> > for certain patterns and rewrites them before
> > the browser gets them?
> >
> > I am thinking something with a
> >
> > RewriteMap foo prg:foo.pl
>
> Nope. mod_rewrite processes _request_URLs_. You'd need Apache 2 which
> provides output filters. If you have already installed Apache 2:
> mod_ext_filter is your friend.
>
> HTH, nd
> --
> Flhacs wird im Usenet grundsätzlich alsfhc geschrieben. Schreibt man
> lafhsc nicht slfach, so ist das schlichtweg hclafs. Hingegen darf man
> rihctig ruhig rhitcgi schreiben, weil eine shcalfe Schreibweise bei
> irhictg nicht als shflac angesehen wird.       -- Hajo Pflüger in dnq
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> 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 <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] complex question

Posted by Jimmy McDonald <io...@bsdshell.dyndns.org>.
> Are you using GNU utilities? I'm guessing not.

It's a Solaris 8 box. The utilities are just the
default utils from SUN. I'm not the admin on the
box so I can't change it.

Thanks, maybe I can get someone to change it for me
but I'm not holding my breath.

Jimmy

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] complex question

Posted by Benjamin Krueger <be...@seattlefenix.net>.
* Jimmy McDonald (iod@bsdshell.dyndns.org) [030505 14:17]:
> > Nope. mod_rewrite processes _request_URLs_. You'd need Apache 2 which
> > provides output filters. If you have already installed Apache 2:
> > mod_ext_filter is your friend.
> 
> While I agree that mod_ext_filter is my friend its not being
> very friendly.
> 
> I have downloaded two seperate versions of the source code
> and run apxs -c mod_ext_filter.c -o mod_ext_filter.so
> 
> It says there was an error in the command.
> I edited apxs to capture the specific error and it spits out:
> 
> ld: fatal: Symbol referencing errors. No output written to
> /home/admin/mod_ext_filter.so
> collect2: ld returned 1 exit status
> apxs:Error: Command /opt/covalent/ers/apache/build/libtool --silent
> --mode=link gcc -o /home/admin/mod_ext_filter.la  -rpath
> /opt/covalent/ers/apache/modules -module -avoid-version
> /home/admin/mod_ext_filter.lo -o /home/admin/mod_ext_filter.so failed with
> rc=65536
> 
> 
> I have also tried to build apache 2.0.44 with --enable=exp_filter=shared
> and copying the the .so file but that build fails with the following:
> 
> 
> Building shared: mod_ext_filter.la
> /bin/bash /home/admin/httpd-2.0.44/srclib/apr/libtool --silent
> --mode=compile gcc  -g -O2 -pthreads    -DSOLARIS2=8
> -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -DAP_HAVE_DESIGNATED_INITIALIZER
> -I/home/admin/httpd-2.0.44/srclib/apr/include

[...]

> grep: illegal option -- e
> Usage: grep -hblcnsviw pattern file . . .
> grep: illegal option -- e
> grep: illegal option -- L
> Usage: grep -hblcnsviw pattern file . . .

Are you using GNU utilities? I'm guessing not.

> 
> I've also tried to download a binary of it with no success.
> Any of these errors useful in debugging this?
> 
> Thanks,
> Jimmy

-- 
Benjamin Krueger

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] complex question

Posted by Jimmy McDonald <io...@bsdshell.dyndns.org>.
> Nope. mod_rewrite processes _request_URLs_. You'd need Apache 2 which
> provides output filters. If you have already installed Apache 2:
> mod_ext_filter is your friend.

While I agree that mod_ext_filter is my friend its not being
very friendly.

I have downloaded two seperate versions of the source code
and run apxs -c mod_ext_filter.c -o mod_ext_filter.so

It says there was an error in the command.
I edited apxs to capture the specific error and it spits out:

ld: fatal: Symbol referencing errors. No output written to
/home/admin/mod_ext_filter.so
collect2: ld returned 1 exit status
apxs:Error: Command /opt/covalent/ers/apache/build/libtool --silent
--mode=link gcc -o /home/admin/mod_ext_filter.la  -rpath
/opt/covalent/ers/apache/modules -module -avoid-version
/home/admin/mod_ext_filter.lo -o /home/admin/mod_ext_filter.so failed with
rc=65536


I have also tried to build apache 2.0.44 with --enable=exp_filter=shared
and copying the the .so file but that build fails with the following:


Building shared: mod_ext_filter.la
/bin/bash /home/admin/httpd-2.0.44/srclib/apr/libtool --silent
--mode=compile gcc  -g -O2 -pthreads    -DSOLARIS2=8
-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -DAP_HAVE_DESIGNATED_INITIALIZER
-I/home/admin/httpd-2.0.44/srclib/apr/include
-I/home/admin/httpd-2.0.44/srclib/apr-util/include
-I/home/admin/httpd-2.0.44/srclib/apr-util/xml/expat/lib -I.
-I/home/admin/httpd-2.0.44/os/unix
-I/home/admin/httpd-2.0.44/server/mpm/prefork
-I/home/admin/httpd-2.0.44/modules/http
-I/home/admin/httpd-2.0.44/modules/filters
-I/home/admin/httpd-2.0.44/modules/proxy
-I/home/admin/httpd-2.0.44/include
-I/home/admin/httpd-2.0.44/modules/dav/main -prefer-pic -c
mod_ext_filter.c && touch mod_ext_filter.slo
/bin/bash /home/admin/httpd-2.0.44/srclib/apr/libtool --silent --mode=link
gcc  -g -O2 -pthreads    -DSOLARIS2=8 -D_POSIX_PTHREAD_SEMANTICS
-D_REENTRANT -DAP_HAVE_DESIGNATED_INITIALIZER
-I/home/admin/httpd-2.0.44/srclib/apr/include
-I/home/admin/httpd-2.0.44/srclib/apr-util/include
-I/home/admin/httpd-2.0.44/srclib/apr-util/xml/expat/lib -I.
-I/home/admin/httpd-2.0.44/os/unix
-I/home/admin/httpd-2.0.44/server/mpm/prefork
-I/home/admin/httpd-2.0.44/modules/http
-I/home/admin/httpd-2.0.44/modules/filters
-I/home/admin/httpd-2.0.44/modules/proxy
-I/home/admin/httpd-2.0.44/include
-I/home/admin/httpd-2.0.44/modules/dav/main -export-dynamic
-L/home/admin/httpd-2.0.44/srclib/apr-util/xml/expat/lib      -o
mod_ext_filter.la -rpath /home/admin/apache44/modules -module
-avoid-version  mod_ext_filter.lo
grep: illegal option -- e
Usage: grep -hblcnsviw pattern file . . .
grep: illegal option -- e
Usage: grep -hblcnsviw pattern file . . .
grep: illegal option -- e
grep: illegal option -- L
grep: illegal option -- /
grep: illegal option -- o
grep: illegal option -- m
grep: illegal option -- e
grep: illegal option -- /
grep: illegal option -- a
grep: illegal option -- d
grep: illegal option -- m
grep: illegal option -- /
grep: illegal option -- t
grep: illegal option -- t
grep: illegal option -- p
grep: illegal option -- d
grep: illegal option -- -
grep: illegal option -- 2
grep: illegal option -- .
grep: illegal option -- 0
grep: illegal option -- .
grep: illegal option -- 4
grep: illegal option -- 4
grep: illegal option -- /
grep: illegal option -- r
grep: illegal option -- /
grep: illegal option -- a
grep: illegal option -- p
grep: illegal option -- r
grep: illegal option -- -
grep: illegal option -- u
grep: illegal option -- t
grep: illegal option -- /
grep: illegal option -- x
grep: illegal option -- m
grep: illegal option -- /
grep: illegal option -- e
grep: illegal option -- x
grep: illegal option -- p
grep: illegal option -- a
grep: illegal option -- t
grep: illegal option -- /
Usage: grep -hblcnsviw pattern file . . .


I've also tried to download a binary of it with no success.
Any of these errors useful in debugging this?

Thanks,
Jimmy

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] mod_ext_filter question

Posted by Jimmy McDonald <io...@bsdshell.dyndns.org>.
This server has never had 1.3 on it.
I will look at the docs mentioned in the other message
and can run it by Covalent as well.

Thanks for all the input from everyone.

Jimmy


On Wed, 30 Apr 2003, [ISO-8859-1] André Malo wrote:

> * Jimmy McDonald wrote:
>
> > Well, I didn't know that was how to make a module from
> > source code since I had never done so before but when trying it
> > this was my output:
> >
> > $ /usr/apache/bin/apxs -c mod_ext_filter.c -o mod_ext_filter.so
> > cc -DEAPI -DMOD_PERL -DUSE_EXPAT -O -G -Kpic -I/usr/apache/include  -c
>
> erm, EAPI is totally useless for apache 2.0 (though I don't know covalent's
> patches ...).
> Do you have an 1.3 still installed? If so, you have to use the appropriate
> apxs version (the 2.0 one).
>
> nd
> --
> > [...] weiß jemand zufällig, was der Tag DIV ausgeschrieben bedeutet?
> DIVerses. Benannt nach all dem unstrukturierten Zeug, was die Leute da
> so reinpacken und dann absolut positionieren ...
>                            -- Florian Hartig und Lars Kasper in dciwam
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> 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 <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] mod_ext_filter question

Posted by André Malo <nd...@perlig.de>.
* Jimmy McDonald wrote:

> Well, I didn't know that was how to make a module from
> source code since I had never done so before but when trying it
> this was my output:
> 
> $ /usr/apache/bin/apxs -c mod_ext_filter.c -o mod_ext_filter.so
> cc -DEAPI -DMOD_PERL -DUSE_EXPAT -O -G -Kpic -I/usr/apache/include  -c

erm, EAPI is totally useless for apache 2.0 (though I don't know covalent's
patches ...).
Do you have an 1.3 still installed? If so, you have to use the appropriate
apxs version (the 2.0 one).

nd
-- 
> [...] weiß jemand zufällig, was der Tag DIV ausgeschrieben bedeutet?
DIVerses. Benannt nach all dem unstrukturierten Zeug, was die Leute da
so reinpacken und dann absolut positionieren ...
                           -- Florian Hartig und Lars Kasper in dciwam

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] mod_ext_filter question

Posted by George Schlossnagle <ge...@omniti.com>.
Google search on that turned up:

http://www.faqts.com/knowledge_base/view.phtml/aid/11449/fid/1

Maybe those things are affecting you?  I imagine at this point Covalent 
tech support might be of help to you.  I don't know if they do anything 
funky with their apxs.

On Wednesday, April 30, 2003, at 03:48  PM, Jimmy McDonald wrote:

> apxs:Break: Command failed with rc=255


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] mod_ext_filter question

Posted by Jimmy McDonald <io...@bsdshell.dyndns.org>.
Well, I didn't know that was how to make a module from
source code since I had never done so before but when trying it
this was my output:

$ /usr/apache/bin/apxs -c mod_ext_filter.c -o mod_ext_filter.so
cc -DEAPI -DMOD_PERL -DUSE_EXPAT -O -G -Kpic -I/usr/apache/include  -c
mod_ext_filter.c
apxs:Break: Command failed with rc=255

Jimmy


On Wed, 30 Apr 2003, George Schlossnagle wrote:

>
> On Wednesday, April 30, 2003, at 03:34  PM, Jimmy McDonald wrote:
> > So, Covalent comes with a bunch of modules available
> > but mod_ext_filter is not one of them and the only way
> > I can implement it is to get mod_ext_filter.so or
> > to compile it somehow.
>
>
> apxs -c mod_ext_filter.c -o mod_ext_filter.so doesn't work for you?
>
> George
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> 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 <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] mod_ext_filter question

Posted by George Schlossnagle <ge...@omniti.com>.
On Wednesday, April 30, 2003, at 03:34  PM, Jimmy McDonald wrote:
> So, Covalent comes with a bunch of modules available
> but mod_ext_filter is not one of them and the only way
> I can implement it is to get mod_ext_filter.so or
> to compile it somehow.


apxs -c mod_ext_filter.c -o mod_ext_filter.so doesn't work for you?

George


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] mod_ext_filter question

Posted by Jimmy McDonald <io...@bsdshell.dyndns.org>.
I can't do that.
I don't have an open source version of apache.
My company does not allow open source applications
to be used for production. I convinced them to purchase
apache through www.covalent.net

The open source piece as availabe is not the problem in
as much as the company requires that all applications have
vendor support and that the applications are certified by
the vendor to work with other applications.

Covalent distibutes a compiled version of the
application with DSO support enabled. They also
have a lot of custom modules that replace the
standard open source modules.

So, Covalent comes with a bunch of modules available
but mod_ext_filter is not one of them and the only way
I can implement it is to get mod_ext_filter.so or
to compile it somehow.

Jimmy


On Wed, 30 Apr 2003, Joshua Slive wrote:

>
> On Wed, 30 Apr 2003, Jimmy McDonald wrote:
> > Now my question is how to I compile the mod_ext_filter.c
> > into the .so?
>
> The easiest way is to go back and recompile the whole server and add that
> module.  See:
> http://httpd.apache.org/docs-2.0/install.html#configure
>
> Just throw in an --enable-ext_filter when you configure.
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> 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 <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] mod_ext_filter question

Posted by Joshua Slive <jo...@slive.ca>.
On Wed, 30 Apr 2003, Jimmy McDonald wrote:
> Now my question is how to I compile the mod_ext_filter.c
> into the .so?

The easiest way is to go back and recompile the whole server and add that
module.  See:
http://httpd.apache.org/docs-2.0/install.html#configure

Just throw in an --enable-ext_filter when you configure.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] mod_ext_filter question

Posted by Jimmy McDonald <io...@bsdshell.dyndns.org>.
Thanks,

I did notice that the ; was used to delimit arguments
on the SetOutputFilter line elsewhere but wanted to double
check.

As far as performance goes, this is a low traffic Sun Fire 280-R
with dual 750MHz and a GB of RAM which isn't near the top of
SUNS product lines but certainly will provide plenty of power.

Now my question is how to I compile the mod_ext_filter.c
into the .so?





On Wed, 30 Apr 2003, Joshua Slive wrote:

>
> On Wed, 30 Apr 2003, Jimmy McDonald wrote:
> > If I wanted to add another change should I do it something like this:
>
> > SetOutputFilter fixtext, fixtext2
>
> It's actually
> SetOutputFilter fixtext;fixtext2
>
> This is documented here:
> http://httpd.apache.org/docs-2.0/mod/core.html#setoutputfilter
> Although there aren't any examples with multiple filters, so you need to
> decipher the "syntax" line.
>
> A couple notes:
>
> 1. As I mentioned before, mod_ext_filter will significantly slow the
> server.  If you can afford that, there is no problem.
>
> 2. You should try to combine your filters into one if at all possible, in
> order to minimize the forking that apache will need to do on each request.
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> 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 <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] mod_ext_filter question

Posted by Joshua Slive <jo...@slive.ca>.
On Wed, 30 Apr 2003, Jimmy McDonald wrote:
> If I wanted to add another change should I do it something like this:

> SetOutputFilter fixtext, fixtext2

It's actually
SetOutputFilter fixtext;fixtext2

This is documented here:
http://httpd.apache.org/docs-2.0/mod/core.html#setoutputfilter
Although there aren't any examples with multiple filters, so you need to
decipher the "syntax" line.

A couple notes:

1. As I mentioned before, mod_ext_filter will significantly slow the
server.  If you can afford that, there is no problem.

2. You should try to combine your filters into one if at all possible, in
order to minimize the forking that apache will need to do on each request.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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


[users@httpd] mod_ext_filter question

Posted by Jimmy McDonald <io...@bsdshell.dyndns.org>.
>From the docs it explains the following, which is exactly
what I want to do:

-------------------[Begin Doc Snippet]-----------------
# mod_ext_filter directive to define a filter which
# replaces text in the response
#
ExtFilterDefine fixtext mode=output intype=text/html \

cmd="/bin/sed s/verdana/arial/g"


<Location />

# core directive to cause the fixtext filter to
# be run on output
SetOutputFilter fixtext

</Location>

-------------------[End Doc Snippet]--------------------

If I wanted to add another change should I do it something like this:

ExtFilterDefine fixtext2 mode=output intype=text/html \

cmd="/bin/sed s/times/palatino/g"

(Just using fonts to keep with the original example)
and then in my <Location> put:


SetOutputFilter fixtext, fixtext2

or

SetOutputFilter fixtext
SetOutputFilter fixtext2

???

Thanks
Jimmy

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] complex question

Posted by André Malo <nd...@perlig.de>.
* Jimmy McDonald wrote:

> How would I go about implementing a script
> that the apache server executes on everything
> it passes to the browser so that it scans
> for certain patterns and rewrites them before
> the browser gets them?
> 
> I am thinking something with a
> 
> RewriteMap foo prg:foo.pl

Nope. mod_rewrite processes _request_URLs_. You'd need Apache 2 which
provides output filters. If you have already installed Apache 2:
mod_ext_filter is your friend.

HTH, nd
-- 
Flhacs wird im Usenet grundsätzlich alsfhc geschrieben. Schreibt man
lafhsc nicht slfach, so ist das schlichtweg hclafs. Hingegen darf man
rihctig ruhig rhitcgi schreiben, weil eine shcalfe Schreibweise bei
irhictg nicht als shflac angesehen wird.       -- Hajo Pflüger in dnq

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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