[prev] [thread] [next] [Date index for 2004/11/16]
------_=_NextPart_001_01C4CBFC.93B86970 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello Harald, =20 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 =3D> PerlResponseHandler), but i'm not shure, i = haven't tried it out until now. =20 package MyApp { sub handler { # do your stuff here } } =20 a startup script "startup.pl" =20 $MyApp::Instance1 =3D new MyApp( # some configuration stuff);=20 $MyApp::Instance2 =3D new MyApp( # other configuration stuff); =20 and in httpd.conf =20 <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> =20 hope that helps, =20 greetings gernot -----Urspr=FCngliche Nachricht----- Von: Harald Meier [mailto:meh1@xxx.xx] Gesendet: Dienstag, 16. November 2004 15:36 An: modperl@xxxx.xxxxxx.xxx 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 = <http://www.foo.bar/myapp/instance1> calls instance 1 http://www.foo.bar/myapp/instance2 = <http://www.foo.bar/myapp/instance2> calls instance 2 ... i have no idea how to handle the module/library problem to make sure = that=20 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.=20 =20 ------_=_NextPart_001_01C4CBFC.93B86970 Content-Type: text/html; charset="iso-8859-1" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <META content="MSHTML 6.00.2800.1458" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=#ffffff> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2>Hello Harald,</FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2>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 ;.)</FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2>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.</FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2>package MyApp {</FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2>sub handler {</FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2> # do your stuff here</FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2>}</FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2>}</FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2>a startup script "startup.pl"</FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2>$MyApp::Instance1 = new MyApp( # some configuration stuff); </FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2>$MyApp::Instance2 = new MyApp( # other configuration stuff);</FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2>and in httpd.conf</FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2><VirtualHost xyz></FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2><Perl></FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2> require 'startup.pl';<BR></Perl></FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2><Location /instance1></FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2> SetHandler perl-script</FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2> PerlHandler $MyApp::Instance1</FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2></Location></FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2><Location /instance2></FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2> SetHandler perl-script</FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2> PerlHandler $MyApp::Instance2</FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2></Location></FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2></VirtualHost></FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2>hope that helps,</FONT></SPAN></DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=797274116-16112004><FONT face=Arial color=#0000ff size=2>greetings gernot</FONT></SPAN></DIV> <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"> <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma size=2>-----Ursprüngliche Nachricht-----<BR><B>Von:</B> Harald Meier [mailto:meh1@xxx.xx]<BR><B>Gesendet:</B> Dienstag, 16. November 2004 15:36<BR><B>An:</B> modperl@xxxx.xxxxxx.xxx<BR><B>Betreff:</B> multiple instances of one web application<BR><BR></FONT></DIV>dear group,<BR><BR>i am developing a web application using apache 2.0 and mod_perl 2.0.<BR>the application is split into a couple of perl modules.<BR><BR>i would like to install the same application more than once on the same <BR>web-server without changing the application code.<BR><BR>so<BR> <A href="http://www.foo.bar/myapp/instance1">http://www.foo.bar/myapp/instance1</A> calls instance 1<BR> <A href="http://www.foo.bar/myapp/instance2">http://www.foo.bar/myapp/instance2</A> calls instance 2<BR> ...<BR><BR>i have no idea how to handle the module/library problem to make sure that <BR>each instance loads its own modules and if a module has changed, the correct <BR>module is reloaded.<BR><BR>i cannot use <VirtualServer> because the servername will always be the same.<BR><BR>my httpd.conf (works only for single instance):<BR><BR> PerlSwitches -w -T -M/opt/myapp/instance1<BR><BR> PerlModule Apache::Reload<BR> PerlInitHandler Apache::Reload<BR> PerlSetVar ReloadAll On<BR><BR> <Location /myapp/instance1><BR> SetHandler perl-script<BR> PerlResponseHandler myapp<BR> PerlOptions +SetupEnv<BR> </Location><BR><BR><BR>thanks for your help!<BR>harald. <BR> <DIV><FONT face=Arial size=2></FONT> </DIV></BLOCKQUOTE></BODY></HTML> ------_=_NextPart_001_01C4CBFC.93B86970--
![]() |
AW: multiple instances of one web application
|
![]() |
![]() |
Re: multiple instances of one web application
|
Generated at 11:26 on 21 Dec 2004 by mariachi v0.52