<VirtualHost _default_:8530> PerlOptions +Parent <Perl> use Apache::ServerUtil; my $s = Apache->server; $s->add_config(['PerlModule TestVhost::basic']); </Perl> </VirtualHost>
The problem is that Apache->server returns the base server, and add_config tries to use the base server's perl context for all the config directives. when it should use the vhost's one (because of PerlOptions +Parent). That means that 'PerlModule TestVhost::basic' gets loaded by the parent server which is not what we want. due to other issues with multiple perl pools, the vhost will eventually load this module too, but it must be not loaded by the base server.
I'm not sure how to deal with it. I was thinking to change the meaning of Apache->server to be equivalent to Apache->request - i.e. it should return the current server and not the base server (unless the current server is the base server). and have a new API for the base server. That should be a doable thing during the server startup, we can just have another global value and reassign it to a different host every time we are inside <perl> sections, perlmodule and perlrequire modperl_cmd handlers. it's somewhat similar to flipping the perl context.
The problem is what to do about it in the latter stages. post_config and open_logs phases receive only the base server object. And to access the vhosts one will need to traverse the servers chain via $s->next. So here Apache->server will be the base server.
It becomes very tricky and expensive during request time, and I'd rather have us not maintain Apache->server here, since we already have it in $r->server.
The bottom line is that we need a way to access vhost $s objects during the startup time (and may be shutdown?) and have this feature not working anywhere else. So may be we should leave Apache->server alone and devise a new API for Apache->current_server which will be available only during the server startup?
Ideas?
__________________________________________________________________ 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
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]