<div dir="ltr"><div><div><div>Hi,<br><br></div><div></div>I have 2 different Dancer apps (app1 and app2). Each one working very well on different servers under Apache and Plack::Handler::Apache2.<br><br></div>Now, I would like put both applications in just one server, so I adjusted the Apache config just adding the two Location sections.</div>
<br><div>If I use the first app, everything works, but when I try the second one, it seems that Dancer2 (with Plack::Handler::Apache2) still looks for the paths of the first app (so it fails because it can not find my app2 modules).<br>
<br></div><div>Example (how to reproduce the behaviour)<br></div><div><br></div><div>0) Dancer 2.06<br><br></div><div>1) Adjust Apache config to add the Locations of the two apps<br><br></div><div># Apache location<br></div>
<div><div><Location /app1><br> SetHandler perl-script<br> PerlHandler Plack::Handler::Apache2<br> PerlSetVar psgi_app /path/app1/bin/<a href="http://app.pl">app.pl</a><br></Location><br><Location /app2><br>
SetHandler perl-script<br> PerlHandler Plack::Handler::Apache2<br> PerlSetVar psgi_app /path/app2/bin/<a href="http://app.pl">app.pl</a><br></Location><br><br></div><div>2) Try app1 => it works!<br><br></div>
<div>3) Try app2 => fails with the next message: Error while loading /app2/<a href="http://app.pl">app.pl</a>: Can't locate App2.pm in @INC (@INC contains /path/app1/lib/ /usr/local....)<br><br></div><div>Where App2 is the main module at (app2/lib/) called from app2/bin/<a href="http://app.pl">app.pl</a> after use Dancer2.<br>
<br></div><div>Thank you<br><div><div><div><br></div></div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/16 sawyer x <span dir="ltr"><<a href="mailto:xsawyerx@gmail.com" target="_blank">xsawyerx@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Sep 16, 2013 at 5:31 PM, Juan José 'Peco' San Martín <span dir="ltr"><<a href="mailto:jsanmartin@gmail.com" target="_blank">jsanmartin@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Hello.<br></div></div></div></div></div></blockquote><div><br></div><div>Hi.<br> <br>
</div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div></div>Although the general answer seems to be: "<a href="https://github.com/PerlDancer/Dancer/issues/521" target="_blank">yes, with Dancer2 it's possible to run multiple applications on the same server</a>", I'm not able to do it :-/<br>
</div></div></div></blockquote><div><br></div></div><div>This relates directly to the ability to have multiple applications in the same Perl processor without serilalizers, responses and so forth stepping over each other. This has been tested and approved as proper. The reason is that Dancer1 has SharedData and other singletons while Dancer2 does not.<br>
<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>
<br><span lang="en"><span>Is it possible</span><span>?</span><span>.</span></span></div></div></blockquote><div><br></div><div>I've never tried. I would simply run a web server (such as Starman) and inside it use Plack::Builder with URLMapper.<br>
</div><div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><span lang="en"> <span>I thought</span> <span>Dancer2</span><span></span> <span>had solved it</span> <span>(instead of</span> <span>Dancer1</span><span>)</span><span>.</span></span><br>
</div></div></blockquote><div><br></div></div><div>Yes. The parts I noted were indeed solved. I have no idea what specific problem you're experiencing and you haven't provided any information to help us understand what you're seeing.<br>
<br></div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>
<br><span lang="en"><span>With</span> <span>the following configuration</span><span>, I can only run</span> <span>one application</span><span> correctly.</span> <span>If I</span> <span>start</span> <span>both</span><span>,</span> <span>I have</span> <span>a mess</span> <span>...</span></span><br>
</div></div></blockquote><div><br></div></div><div>Could you please provide more information other than "I have a mess"?<br></div><div>Example of your situation and the problem you're experiencing will help us find the problem.<span class="HOEnZb"><font color="#888888"><br>
<br></font></span></div><span class="HOEnZb"><font color="#888888"><div>Sawyer.<br></div></font></span></div></div></div>
<br>_______________________________________________<br>
dancer-users mailing list<br>
<a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
<a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
<br></blockquote></div><br></div>