Beefy Boxes and Bandwidth Generously Provided by pair Networks Ovid
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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


Comment on Re: Dynamic @INC under mod_perl2 (Apache2 VirtualHost)
Select or Download Code
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/Menu.pm 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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://539773]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2014-04-16 05:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (414 votes), past polls