nojjynb has asked for the wisdom of the Perl Monks concerning the following question:

I have a Catalyst app. It runs fine in CGI mode on it's own subdomain (abc.myserver.com), but it doesn't run from the subdirectory (myserver.com/abc). What do I need to change to make this work? Do I need to update the Catalyst App? The .htaccess file (it is on a hosted server, so I don't have access to any other configs)?

The reason I need to use the subdirectory instead of the subdomain is so I can use the right SSL cert. If there is an easy way to get the SSL cert to work with abc.myserver.com as well as www.myserver.com, I would love to hear that instead.

Replies are listed 'Best First'.
Re: Catalyst from a sub directory
by bms (Monk) on Mar 14, 2012 at 04:26 UTC

    This problem is fairly common. CGI scripts need to be in a directory that explicitly allows their execution. This is typically cgi-bin, but any directory can be configured to allow the execution of CGI scripts. This requires access to server configuration files though. Another option is to deploy in cgi-bin and use mod_rewrite to pretty up your urls.

Re: Catalyst from a sub directory
by Anonymous Monk on Mar 14, 2012 at 04:18 UTC

    Um, how do you run it?

    See Plack and multiple domains. Simplest option

    $ cat mycatapps.psgi #!/usr/bin/perl -- use strict; use warnings; use MyCatalystApp; use MyOtherCatalystApp; use MySharona; use Plack::App::URLMap; my $app; { my $urlmap = Plack::App::URLMap->new; my $catapp = MyCatalystApp->apply_default_middlewares(MyCatalystAp +p->psgi_app); $urlmap->map( '/catapp' => $catapp ); my $sharona = MySharona->apply_default_middlewares(MySharona->psgi +_app); $urlmap->map( '/sharona' => $sharona ); my $other = MyOtherCatalystApp->apply_default_middlewares(MyOtherC +atalystApp->psgi_app); $urlmap->map( '/other' => $other ); $app = $urlmap->to_app;; } $app;

    http://advent.plackperl.org/2009/12/day-12-maps-multiple-apps-with-mount-and-urlmap.html