Yes, but that's a horrible solutions (thinking "utter nightmare" when it
comes to system administration, et. al.).


I've currently got it working with this (which seems to be MUCH more
elegant, only requires a single Apache server, no virtual-hosts, is
directory-based, and requires no special configs in httpd.conf --
just .htaccess files -- given of course that MP2 is loaded):

<Perl>
  my $env = $0;
  $env =~ s:^(/usr/env\d+)/.*:$1:;
  push @PerlInitHandler, "MyAuth::Dispatch";
  push @PerlSetEnv, [ LIBDIR => "$env/lib" ];
</Perl>


I feel that's a much better solution. Here's Dispatch:

package MyAuth::Dispatch;
use strict;
use warnings;
sub handler()
{
    my ( $r ) = @_;
    my $libdir = $ENV{LIBDIR} || "";
    unshift @INC, $libdir if $libdir;
    require MyAuth::Authnz;
    return &MyAuth::Authnz::handle($r);
}
1;


Now doesn't that work a heck of a lot better?
--
Devin







On Tue, 2009-10-20 at 14:32 -0400, Michael Peters wrote:
> On 10/20/2009 01:06 PM, Devin Teske wrote:
> 
> > I've been trying for what feels like months now to find some way to have
> > two directories specify the same module name to PerlInitHandler but to
> > use two different modules.
> 
> This isn't a limitation of mod_perl but a limitation of Perl. You can't 
> have 2 different modules with the same name. This comes up from time to 
> time on this list and the best advice usually comes down to this:
> 
> Run multiple apaches (on the same machine if you want). Then put a proxy 
> in front to redirect to the right one based on the host or path or 
> whatever. This is just slightly more complicated to set up, but is the 
> most flexible and doesn't require as many resources as it initially appears.
> 
-- 
Cheers,
Devin Teske

-> CONTACT INFORMATION <-
Field Engineer
FIS - Vicor Business Unit
626-573-6040 Office
510-735-5650 Mobile
devin.te...@metavante.com

-> LEGAL DISCLAIMER <-
This message  contains confidential  and proprietary  information
of the sender,  and is intended only for the person(s) to whom it
is addressed. Any use, distribution, copying or disclosure by any
other person  is strictly prohibited.  If you have  received this
message in error,  please notify  the e-mail sender  immediately,
and delete the original message without making a copy.

-> END TRANSMISSION <-

Reply via email to