[Catalyst] Running multiple catalyst apps under mod_perl

Michael Reece mreece at sacbee.com
Tue Mar 29 01:29:32 CEST 2005


I spoke too soon.  Each Catalyst app appears to be willing to handle the
requests of the other.

I set up two small test applications.

----------
package Test1;

use strict;
use Catalyst qw/-Debug/;

Test1->config(
    name => 'Test1',
    root => '/usr/local/apache_perl/packages/Test1/root',
);

Test1->action(
    '!default' => sub {
        my ( $self, $c ) = @_;
        $c->res->output('Congratulations, Test1 is on Catalyst!');
    },
);
----------

And:

----------
package Test2;

use strict;
use Catalyst qw/-Debug/;

Test2->config(
    name => 'Test2',
    root => '/usr/local/apache_perl/packages/Test2/root',
);

Test2->action(
    '!default' => sub {
        my ( $self, $c ) = @_;
        $c->res->output('Congratulations, Test2 is on Catalyst!');
    },
);
----------

And, in httpd.conf:

----------
<Location /test1>
    <Perl>
    use lib '/usr/local/apache_perl/packages/Test1/lib';
    </Perl>
    SetHandler perl-script
    PerlHandler Test1
</Location>
    
<Location /test2>
    <Perl>
    use lib '/usr/local/apache_perl/packages/Test2/lib';
    </Perl>
    SetHandler perl-script
    PerlHandler Test2
</Location>
----------

And, it is a virtual coin-flip as to which message gets displayed (Test1 vs
Test2) at either URL, http://localhost/test1 and http://localhost/test2

Any ideas?


On 3/28/05 3:11 PM, "Michael Reece" <mreece at sacbee.com> wrote:

> Also, to follow up on my initial reasons for testing, Catalyst appears to
> behave wonderfully with multiple applications.

> On 3/28/05 2:25 PM, "Michael Reece" <mreece at sacbee.com> wrote:

>>> I am testing out Catalyst as an alternative to Maypole (specifically
>>> MasonX::Maypole).  My major gripe about Maypole and MXM is that it shares
>>> config data across applications and I have not been able to reconcile all
>>> the issues in order to run multiple apps on the same mod_perl apache
>>> (Apache/1.3.27).




More information about the Catalyst mailing list