Stas Bekman wrote:
> If you have followed the end of the long story on windows with free to
> wrong pool, you'd have known that one of the reason for the problem was
> the use of the wrong context in add_config in the following snippet:
> 
> <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. 

right.  the answer here is "don't do that." that is, don't use the base
server to add configurations to vhosts.

but $s->add_config ought to be just fine when called from a PerlRequire
directive outside of any <VirtualHost> containers, which ought to add
directives to the main server.  if it doesn't, or if using it from <Perl>
sections is different than using it from a startup.pl, then it's a bug (sort
of) separate from all of this.

> 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.

outside of all of this, can you really scope PerlModule like that?  in mp1
PerlModule was global in scope.  I guess now it's possible to allocate
interpreters specific to vhosts, so now we can restrict module usage to a
vhost as well?

> 
> 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.

I think Apache->server should always return the base server, allowing you to
iterate over the servers.  the problem is knowing which server is the right
vhost as you iterate over it.  you could probably use $s->server_hostname if
you have a ServerName set up for the host, but that's not guaranteed.  so, I
like the idea of Apache->current_server, which would be guaranteed to give
you the server_rec from the current vhost.

--Geoff


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to