Geoffrey Young wrote:
Torsten Foertsch wrote:
Hi,
I have created my own configuration directives with Apache2::Module::add. How
can I access the values from an PostConfig handler?
I have got it working with the main server. But if my directives are inside a
VirtualHost they are not accessible.
Apache2::ServerUtil->server
IIRC the issue is that in post-config you aren't actually attached to a
server, so you need to iterate the list of servers and find the one (by name
I guess) that you are intersted in. IIRC there were some examples in the
archives of how to do this. at the very least you can check out
mod_rewrite, which I belive does exactly that (in C though :)
It's documented:
http://perl.apache.org/docs/2.0/api/Apache2/ServerRec.html#C_next_
http://perl.apache.org/docs/2.0/user/handlers/server.html#C_PerlOpenLogsHandler_
Torsten, if you think we could add a xref to this technique elsewhere that
it'd make it easier to find it, please suggest. I agree that it's not easy
to do now, unless you know things well.
e.g. may be a xref from:
http://perl.apache.org/docs/2.0/user/handlers/server.html#C_PerlPostConfigHandler_
to:
http://perl.apache.org/docs/2.0/user/handlers/server.html#C_PerlOpenLogsHandler_
will help? e.g.:
If you want to traverse the configured virtual hosts, you can accomplish
that using a simple loop (see PerlOpenLogsHandler for an example)
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com