Loading ...
Sorry, an error occurred while loading the content.

65742PerlOptions +Parent and Virtual Hosts problem

Expand Messages
  • Adam Batkin
    Jun 28, 2005
      I noticed two problems (possibly just documentation issues?) when
      playing with PerlOptions +Parent and virtual hosts:

      PerlSwitches -Mlib and -I were completely ignored within the VirtualHost

      And more importantly...

      I have 3 virtual hosts (not NameVirtualHosts, but separate IPs), A, B
      and C, each with their own set of modules and I want to keep their
      namespaces completely separate. Naturally, within each VirtualHost
      directive I included "PerlOptions +Parent" and then
      PerlPostConfigRequire'd a startup.pl for each one (and of course the
      startup.pl for each one had a different "use lib" line, since I couldn't
      use the options from problem #1 above)
      I ran a quick MP program on each vhost to dump @INC, and each vhost
      reported the exact same @INC...in addition to the usual directories, all
      three had the lib directory for all three sites.

      Conclusion: PerlOptions +Parent wasn't doing anything. i.e. the first
      vhost (A) executed its startup.pl, which added A's lib directory to
      @INC, then B added its lib to the same @INC, then C did the same.

      I managed to fix this by adding a PerlOptions +Parent line above/outside
      all of the vhosts (generic location in httpd.conf)

      Is this normal? Should this perhaps be documented, or is it, and I just
      misunderstood the mp2 config guide?

      This is perl 5.8.5, mod_perl 2.0.0 and httpd 2.0.52 (all are stock RHEL4
      ES except MP which I built myself)

      Thoughts? I'm happy to do more testing (like experimenting with
      NameVirtualHost vhosts instead, +Clone instead of +Parent, etc...) if
      that would be useful, but for now it's late.


      -Adam Batkin