On Tue, November 13, 2007 8:34 am, Jim Brandt wrote:
> Where are those ENV variables being set? Is it in:
>
>      PerlRequire /opt/rt3/bin/webmux.pl
>
> I believe you need to make sure the second perl interpreter runs the
> same startup scripts as the first since it is completely new.

Yes, that's right, and that's what I'm doing.

I finally figured this out.  The docs say:

  <VirtualHost ...>
      ServerName dev1
      PerlOptions +Parent
      PerlSwitches -Mlib=/home/dev1/lib/perl
  </VirtualHost>

  <VirtualHost ...>
      ServerName dev2
      PerlOptions +Parent
      PerlSwitches -Mlib=/home/dev2/lib/perl
  </VirtualHost>

  http://perl.apache.org/docs/2.0/user/config/config.html#C_Parent_

but the problem I was running into was that the main (default) Apache
host wasn't using mod_perl.  The first time mod_perl was getting loaded
was in VirtualHost #1.  Setting +Parent at this point seems to confuse
mod_perl and reset the environment variable table to some minimal static
set.

What I've done is this (using the example above):

  <VirtualHost ...>
      ServerName dev1
      #PerlOptions +Parent  Don't load new interpreter -- this is the parent!
      PerlSwitches -Mlib=/home/dev1/lib/perl
  </VirtualHost>

  <VirtualHost ...>
      ServerName dev2
      PerlOptions +Parent
      PerlSwitches -Mlib=/home/dev2/lib/perl
  </VirtualHost>

Now both VirtualHosts run fine, and there's no need to pass variables
from httpd.conf as each RT install directory has its own set of
hardcoded database connection parameters compiled into its startup code.


Reply via email to