Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Dynamic @INC under mod_perl2 (Apache2 VirtualHost)

by idsfa (Vicar)
on Mar 28, 2006 at 18:26 UTC ( #539773=note: print w/replies, xml ) Need Help??

in reply to Dynamic @INC under mod_perl2 (Apache2 VirtualHost)

You almost have it. You also need the Parent option. See the docs for more info.

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

The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. — Cyrus H. Gordon

Replies are listed 'Best First'.
Re^2: Dynamic @INC under mod_perl2 (Apache2 VirtualHost)
by ikegami (Pope) on Mar 28, 2006 at 18:37 UTC

    Keeping in mind the important piece of info in the parent post is PerlOptions +Parent, the docs also say -Mlib=... is buggy on certain platforms. -I... does the same thing, except it doesn't remove duplicates (which is no biggy). Therefore, he should keep his -I... and simply add PerlOptions +Parent, as follows:

    <VirtualHost ...> ServerName dev PerlOptions +Parent PerlSwitches -I/home/dev/lib/perl </VirtualHost> <VirtualHost ...> ServerName test PerlOptions +Parent PerlSwitches -I/home/test/lib/perl </VirtualHost>

    I presume his LoadModule needs to be placed in <VirtualHost> for it to work?

      Thank you - I am making progress.

      I've setup Apache to listen on port 8080 and Included VH config file like so:

      But I get this error, despite my best efforts:
      Can't locate object method "log_error" via package "Apache2::RequestRe +c" at /home/graq/lib/GRAQ/ line 56.

      This all used to work with liberal smatterings of <Perl> use lib 'home/graq/lib';</Perl> and I'm getting a little lost on exactly what effects my changes have had on the mod_perl environment.

      I remember having this error when porting from mp1 to mp2, but can't find any notes on it or hints from the docs on what object I should have in handler...?

      -=( Graq )=-
        Looking through the Apache2::RequestRec documentation shows that log_error actually exists on Apache2::Log (which extends Apache2::RequestRec).

        For whatever reason, that extension was not loaded with the new configuration. Adding use Apache2::Log; to my modules fixed the problem.

        Thank you all for your help

        -=( Graq )=-

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://539773]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2017-12-17 14:50 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (464 votes). Check out past polls.