Hello Harald,
 
i think you can use instances instead of classes, under mod_perl 1 i have the following setup (the code ist just to show how it should work ;.)
under mod_perl, i think you just have to change the name of the directives(PerlHandler => PerlResponseHandler), but i'm not shure, i haven't tried it out until now.
 
package MyApp {
sub handler {
 # do your stuff here
}
}
 
a startup script "startup.pl"
 
$MyApp::Instance1 = new MyApp( # some configuration stuff);
$MyApp::Instance2 = new MyApp( # other configuration stuff);
 
and in httpd.conf
 
<VirtualHost xyz>
<Perl>
    require 'startup.pl';
</Perl>
<Location /instance1>
   SetHandler perl-script
   PerlHandler $MyApp::Instance1
</Location>
<Location /instance2>
   SetHandler perl-script
   PerlHandler $MyApp::Instance2
</Location>
</VirtualHost>
 
hope that helps,
 
greetings gernot
-----Ursprüngliche Nachricht-----
Von: Harald Meier [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 16. November 2004 15:36
An: [EMAIL PROTECTED]
Betreff: multiple instances of one web application

dear group,

i am developing a web application using apache 2.0 and mod_perl 2.0.
the application is split into a couple of perl modules.

i would like to install the same application more than once on the same 
web-server without changing the application code.

so
    http://www.foo.bar/myapp/instance1 calls instance 1
    http://www.foo.bar/myapp/instance2 calls instance 2
    ...

i have no idea how to handle the module/library problem to make sure that 
each instance loads its own modules and if a module has changed, the correct 
module is reloaded.

i  cannot use <VirtualServer> because the servername will always be the same.

my httpd.conf (works only for single instance):

   PerlSwitches -w -T -M/opt/myapp/instance1

   PerlModule      Apache::Reload
   PerlInitHandler Apache::Reload
   PerlSetVar      ReloadAll On

   <Location /myapp/instance1>
       SetHandler                     perl-script
       PerlResponseHandler     myapp
       PerlOptions                    +SetupEnv
   </Location>


thanks for your help!
harald. 
 

Reply via email to