On Fri, 19 Apr 2002 21:12:35 +0200 (CEST) "Sören Stuckenbrock" 
<[EMAIL PROTECTED]> wrote:

> Hi there,
> 
> mod_perl-newbie needs help!
> I have a nasty problem using Perl Modules under mod_perl.
> I've developed a CGI-Application, that retrieves its configuration values
> from a module that gets included (with "use") in every Script of the
> application.
> So far no problem.
> 
> But when I try to set up more than one instance of the application on the
> same (virtual) server under different paths, with different configuration
> values in the config-module (which I must do) mod_perl mixes up the
> different configuration-modules. Every httpd-child only loads the
> configuraion module of the applications instance that it first served a
> request for.
> If the same process serves a request for a different instance later, it
> always uses the config-module of the instance it first served a request for,
> because it thinks it already has loaded the right module.
> 
> Has anyone ever had a similar problem, or knows what I could do to fix this
> behavior?
> If there should be no solution to this problem, does anyone know a way to
> have something like a central configuration for a bunch of perl-scripts,
> that is performing as good as using a Module/package and works in the
> scenario described above?

   I would suggest moving away from a module for configuration and into 
   using PerlSetVar's in your Apache config such as: 

   PerlSetVar OptionOne Foo

   and then retrieved in the code as my $option_one = $r->dir_config('OptionOne'); 

   This way you can do it on a per Location, Directory, etc. basis. 

 ---------------------------------
   Frank Wiles <[EMAIL PROTECTED]>
   http://frank.wiles.org
 ---------------------------------

Reply via email to