You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Kevin Slean <ke...@wctravel.com> on 2002/02/11 22:29:43 UTC

Influencing @INC list

Mod Perl Mongers...

I need to run multiple apache servers on one Solaris 2.7 box configured in
such a way that each of them accesses their own private copy of perl
libraries.  I would like to achieve this configuration with the
least amount of changes to my over all implementation.

For instance, given 2 apache servers defined in the following 2 directories:

   /usr/local/siteA   <- directory tree containing everything for server A
   /usr/local/siteB   <- directory tree containing everything for server B

The default perl installation on this unix system is under
/usr/local/lib/perl5 and the default @INC list is:

   /usr/local/lib/perl5/5.6.0/sun4-solaris
   /usr/local/lib/perl5/5.6.0
   /usr/local/lib/perl5/site_perl/5.6.0/sun4-solaris
   /usr/local/lib/perl5/site_perl/5.6.0
   /usr/local/lib/perl5/site_perl
   .

BUT, I would like to influence the @INC list so it looks in a SITE/SERVER
specific directory.  SiteA's @INC list would be:

   /usr/local/lib/perl5/5.6.0/sun4-solaris
   /usr/local/lib/perl5/5.6.0
   /usr/local/lib/perl5/site_perl/5.6.0/sun4-solaris/SITEA   <-- Note SITEA
directory appended here
   /usr/local/lib/perl5/site_perl/5.6.0
   /usr/local/lib/perl5/site_perl
   .

And SiteB's @INC list would be:

   /usr/local/lib/perl5/5.6.0/sun4-solaris
   /usr/local/lib/perl5/5.6.0
   /usr/local/lib/perl5/site_perl/5.6.0/sun4-solaris/SITEB   <-- Note SITEB
directory appended here
   /usr/local/lib/perl5/site_perl/5.6.0
   /usr/local/lib/perl5/site_perl
   .

Note that SiteA should not have access to SiteB's modules stored in the
SITEB directory (and vica versa).

Kevin


Re: Influencing @INC list

Posted by Stephen Reppucci <sg...@logsoft.com>.
OK, I'll be the one to throw out the gratuitous plug for Geoff,
etal's book. The Mod_Perl Cookbook has a nice discussion of exactly
this in Chapter 2. (I'd give you the page, but I left it at work...)

(I'm only through the first few chapters, but from what I've read so
far, this is a real winner.  Buy it.)

<Steve>

On Mon, 11 Feb 2002, Brian Reichert wrote:

> On Mon, Feb 11, 2002 at 04:29:43PM -0500, Kevin Slean wrote:
> >
> > Mod Perl Mongers...
> >
> > I need to run multiple apache servers on one Solaris 2.7 box configured in
> > such a way that each of them accesses their own private copy of perl
> > libraries.  I would like to achieve this configuration with the
> > least amount of changes to my over all implementation.
> >
> > For instance, given 2 apache servers defined in the following 2 directories:
> >
> >    /usr/local/siteA   <- directory tree containing everything for server A
> >    /usr/local/siteB   <- directory tree containing everything for server B
> >
> > The default perl installation on this unix system is under
> > /usr/local/lib/perl5 and the default @INC list is:
>
> I believe you can abuse PERL5LIB in each vhost...
>
> >
> > Kevin
> >
>
>

-- 
Steve Reppucci                                       sgr@logsoft.com |
Logical Choice Software                          http://logsoft.com/ |
=-=-=-=-=-=-=-=-=-=-  My God!  What have I done?  -=-=-=-=-=-=-=-=-=-=


Re: Influencing @INC list

Posted by Brian Reichert <re...@numachi.com>.
On Mon, Feb 11, 2002 at 04:29:43PM -0500, Kevin Slean wrote:
> 
> Mod Perl Mongers...
> 
> I need to run multiple apache servers on one Solaris 2.7 box configured in
> such a way that each of them accesses their own private copy of perl
> libraries.  I would like to achieve this configuration with the
> least amount of changes to my over all implementation.
> 
> For instance, given 2 apache servers defined in the following 2 directories:
> 
>    /usr/local/siteA   <- directory tree containing everything for server A
>    /usr/local/siteB   <- directory tree containing everything for server B
> 
> The default perl installation on this unix system is under
> /usr/local/lib/perl5 and the default @INC list is:

I believe you can abuse PERL5LIB in each vhost...

> 
> Kevin
> 

-- 
Brian 'you Bastard' Reichert		<re...@numachi.com>
37 Crystal Ave. #303			Daytime number: (603) 434-6842
Derry NH 03038-1713 USA			Intel architecture: the left-hand path

Re: Influencing @INC list

Posted by Ged Haywood <ge...@www2.jubileegroup.co.uk>.
Hi there,

On Mon, 11 Feb 2002, Kevin Slean wrote:

> I need to run multiple apache servers on one Solaris 2.7 box configured in
> such a way that each of them accesses their own private copy of perl
> libraries.

Could you accept recompiling Perl without the couple of paths which
get in the way, and then add the missing paths with use lib(...)?

There's lots of stuff about @INC in the Guide.

73,
Ged.