Java Mailing List Archive

http://www.apache-httpd.com/

Home » modperl.perl »

PerlOptions +Parent and virtual hosts

Bryn Dyment

2009-05-01


Author LoginPost Reply
Hello,

I have successfully been using name-based virtual hosts and have just
added "PerlOptions +Parent" as a way to have multiple branches of my
codebase running on the same server. A typical virtual host is
configured as:

<VirtualHost *:80>
  ServerName   trunk.translator.xcma.devo
  DocumentRoot C:\depot\trunk\perl\xcma\translator\html

  PerlOptions +Parent

  <Perl>
    use lib 'C:\depot\trunk\perl\common';
    use lib 'C:\depot\trunk\perl\xcma\common';
    use lib 'C:\depot\trunk\perl\xcma\translator';
  </Perl>

  PerlRequire C:\depot\trunk\perl\xcma\translator\translator.pl

  PerlSetVar MasonAutohandlerName autohandler.mas
  PerlSetVar MasonCompRoot     "site =>
C:\depot\trunk\perl\xcma\translator\html"
  PerlAddVar MasonCompRoot     "comp => C:\depot\trunk\perl\common\html"
  PerlSetVar MasonDataDir
C:\WINDOWS\Temp\mason\trunk.translator.xcma.devo
  PerlSetVar MasonEscapeFlags   "h =>
\&HTML::Mason::Escapes::basic_html_escape"

  <LocationMatch "\.(css|html|js)$">
    SetHandler  perl-script
    PerlHandler HTML::Mason::ApacheHandler
  </LocationMatch>
</VirtualHost>

The only difference versus the other virtual hosts is the replacement
of "trunk" with "release".

When I launch Apache, it crashes unless I also have the following
virtual host configured at the end of my httpd.conf:

<VirtualHost *:80>
  ServerName   localhost
  DocumentRoot C:

  PerlOptions  +Enable
</VirtualHost>

I've found that I can have any perl-related directive in place of
"PerlOptions +Enable" (e.g., replaced with "PerlModule HTML::Mason").
If I remove the directive, or if I remove this virtual host
altogether, it crashes (with no error). This is on Windows ... my
development environment ... haven't experimented on my Linux server
yet.

Hoping somebody can help ... thanks!
©2008 apache-httpd.com - Jax Systems, LLC, U.S.A.