[dancer-users] Collision of multiple Dancer2 apps using Plack::Handler::Apache2

Juan José 'Peco' San Martín jsanmartin at gmail.com
Tue Sep 17 10:36:00 BST 2013


Hi,

I have 2 different Dancer apps (app1 and app2). Each one working very well
on different servers under Apache and Plack::Handler::Apache2.

Now, I would like put both applications in just one server, so I adjusted
the Apache config just adding the two Location sections.

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).

Example (how to reproduce the behaviour)

0) Dancer 2.06

1) Adjust Apache config to add the Locations of the two apps

# Apache location
<Location /app1>
    SetHandler perl-script
    PerlHandler Plack::Handler::Apache2
    PerlSetVar psgi_app /path/app1/bin/app.pl
</Location>
<Location /app2>
   SetHandler perl-script
   PerlHandler Plack::Handler::Apache2
   PerlSetVar psgi_app /path/app2/bin/app.pl
</Location>

2) Try app1 => it works!

3) Try app2 => fails with the next message: Error while loading /app2/app.pl:
Can't locate App2.pm in @INC (@INC contains /path/app1/lib/ /usr/local....)

Where App2 is the main module at (app2/lib/) called from
app2/bin/app.plafter use Dancer2.

Thank you



2013/9/16 sawyer x <xsawyerx at gmail.com>

> On Mon, Sep 16, 2013 at 5:31 PM, Juan José 'Peco' San Martín <
> jsanmartin at gmail.com> wrote:
>
>> Hello.
>>
>
> Hi.
>
> Although the general answer seems to be: "yes, with Dancer2 it's possible
>> to run multiple applications on the same server<https://github.com/PerlDancer/Dancer/issues/521>",
>> I'm not able to do it :-/
>>
>
> 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.
>
>
>> Is it possible?.
>>
>
> I've never tried. I would simply run a web server (such as Starman) and
> inside it use Plack::Builder with URLMapper.
>
>
>> I thought Dancer2 had solved it (instead of Dancer1).
>>
>
> 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.
>
>
>> With the following configuration, I can only run one applicationcorrectly. If
>> I start both, I have a mess ...
>>
>
> Could you please provide more information other than "I have a mess"?
> Example of your situation and the problem you're experiencing will help us
> find the problem.
>
> Sawyer.
>
> _______________________________________________
> dancer-users mailing list
> dancer-users at dancer.pm
> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20130917/f99f0e4b/attachment.htm>


More information about the dancer-users mailing list