[Catalyst] FastCGI External

Jonathan Rockway jon at jrock.us
Tue Dec 5 16:28:51 GMT 2006

Sébastien Wagener wrote:
> I have a Catalyst application that is running as an external FastCGI
> process. My Apache config looks like 
> 	FastCgiExternalServer /tmp/myapp -socket /tmp/myapp.socket
> [...]
>          Alias /myapp/ /tmp/myapp/
> If I call http://localhost/myapp/user/login, Catalyst receives a request
> for "login" instead of "user/login". (MyApp Log: "GET" request for
> "login")

If I'm understanding you correctly, the problem is that $c->base changes
for each request.  For myapp.com/foo, the base is /, but for
myapp.com/foo/bar, it's foo.  If that's the case, I solved the problem
by putting the FastCgiExternalServer path inside the docroot and added a
.fcgi extension to it:

DocumentRoot /var/www/htdocs
FastCgiExternalServer /var/www/htdocs/myapp.fcgi [-host|-socket] ...
Alias / /var/www/htdocs/myapp.fcgi
# etc.

I think the .fcgi is required due to an implicit SetHandler fcgi-script
somewhere.  If you set it explicitly, you may have more freedom on naming.

Hope this helps.

package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
$,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;

More information about the Catalyst mailing list