You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Harald Meier <me...@rts.at> on 2004/11/16 11:06:29 UTC
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.
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: multiple instances of one web application
Posted by Stas Bekman <st...@stason.org>.
Harald Meier wrote:
> 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.
I guess you are talking about the solution proposed here:
http://perl.apache.org/docs/2.0/user/config/config.html#C_Parent_
> 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>
If you can't use Vhosts, see if the mp1 solution is applicable.
http://perl.apache.org/docs/1.0/guide/config.html#Is_There_a_Way_to_Modify__INC_on_a_Per_Virtual_Host_or_Per_Location_Basis_
but may be your whole approach is wrong. And you shouldn't install the
same application more than once. usually the only reason one will want
more than one is when there is more than one developer, but those
approaches at the link above aren't any good for production env.
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html