Hi!

I've encountered very interesting problem. When I set some variable
using PerlSetVar in configuration files for different virtual servers
they seem to be available to ALL of those virtual servers.

Here's details to clarify.

In httpd.conf I have

<VirtualHost myhost1.domain.com>
ServerName   myhost1.domain.com
DocumentRoot /httpd/docs
ErrorLog logs/httpd-errors
CustomLog logs/httpd-log common
AccessConfig conf/access.conf
ResourceConfig conf/srm.conf
</VirtualHost>

<VirtualHost myhost2.domain.com>
ServerName   myhost2.domain.com
DocumentRoot /httpd/docs
ErrorLog logs/httpd2-errors
CustomLog logs/httpd2-log common
AccessConfig conf/access2.conf
ResourceConfig conf/srm2.conf
</VirtualHost>


Now in srm.conf I set

PerlSetVar MyVariable MyValue
PerlAuthenHandler        Apache::Myhandler


And in srm2.conf I have

PerlSetVar MyVariable2 MyValue2
PerlAuthenHandler        Apache::Myhandler

In Myhandler::handler I do 
$myvar1 = $r->dir_config('MyVariable');
$myvar2 = $r->dir_config('MyVariable2);

if($myvar1){
## do stuff for first virtual server
}else{
## do stuff for the second one
}

But $myvar1 appears to be ALWAYS set. Which leads me to belief that
mod_perl "shares" variables between virtual servers if those variables
are not explicitly set in configuration for that server.

Is this supposed to be this way? Or am I missing something?

Andrei

-- 

Reply via email to