At 18:27 10/12/2000 +0100, Stas Bekman wrote:
>Check this out:
>http://perl.apache.org/guide/config.html#Apache_Configuration_in_Perl
>at the end of the section...

Stas there's just way too much good information in the guide ;) mount -t
html http://perl.apache.org/guide /brain/docs/guide would sure be a nice
thing to see possible.

>You don't need perl sections to configure Apache in Perl, just declare the
>Apache::ReadConfig package and do what you want... in Perl of
>course... and call it from startup.pl or else... before the server is
>started.

That a really nice thing to know and chances are I'll use it for some
things. But the rub is I don't want to configure my Apache in Perl. Perl is
great for many things but apart from the cases where one can benefit from
dynamic configuration (eg pulling conf info from a database, using the same
conf for several servers that want different settings, defining many vhosts
in a loop, etc...) I don't think it's a big win over using a syntax that
was tailored for configuration. The latter is much more legible.

Right now the situation is that when one wants to add a new type of
directive that Apache understands, one has to write a custom Makefile.PL
that will take care of generating some XS that will know how to talk to
Apache and to take the right steps required by the directive when it
appears. That's not quite as easy as doing pure Perl, requires some
compilation and occasionally cause mysterious problems with other modules
(eg AxKit and PHP for instance).

What I'd like to do is to provide the same functionality (ie the ability to
add new directives) but in a pure Perl fashion that wouldn't need to
interact with Apache at all, using Perl's Filter framework. Using that, one
would be able to provide directives that have the same kind of syntax as
the normal Apache directives. Of course, because this is Perl, one could
also invent all sorts of strange new directives using any kind of syntax
that Perl can parse.

Unfortunately, this doesn't appear to be possible directly within
httpd.conf :( The closest I got to making it work is by having an
httpd.conf containing solely:

<Perl>
require "conf/filtered_conf.conf";
</Perl>

and then have filtered_conf.conf contain my regular Apache conf, in
addition to use Apache::FilterConf; at the top and any custom directives
that I might want to have. But easy as it is to simply change one's
configuration to fit that scheme, it isn't as straightforward as having to
simply activate the filter on your conf and be done.

Anyway, thanks for the input :) If I come up with a viable solution, I'll
post it to the list.

-- robin b.
Radioactive cats have 18 half-lives.

Reply via email to