lazy saunter

(personal learnings in computation)

Thursday, March 26, 2009

catalyst, 4: deployment

much like RubyOnRails and CakePHP (from what i remember), the basic Catalyst setup for developing an application relies on its own server which runs on port 3000. i remember getting stuck at this point with RoR and wondering how anyone ever put anything into production like that (fortunately with catalyst i have gotten beyond that). obviously, an acceptable goal for a production application would be to run on port 80 so that the URL's don't have to specify some funky port number and that the application would not require its own server running.

the catalyst cookbook suggests several methods for accomplishing this. i did not pursue the method using mod_perl since i would want to put my applications on other people's servers for which i could not completely re-configure their web server. the second method uses fastcgi. apache would have to already be configured to enable mod_fastcgi in this case (but this is much more likely than finding a server with mod_perl enabled).

using fastcgi, there are yet more options. the first i got to work was to run fastcgi as a standalone server and have apache connect to this process. this implementation assumes that you have access to a shell from which to launch the fastcgi server process and that you have minimal access to the apache configuration.

to launch 3 instances of the fastcgi server and have them run as daemons in the background:
script/res_fastcgi.pl -l /tmp/res.socket -n 3 -p /tmp/res.pid -d

for the configuration (which in my case i put in conf.d/):
FastCgiExternalServer /tmp/res.fcgi -socket /tmp/res.socket
Alias / /tmp/res.fcgi/

if you do have fairly good access to your apache configuration, this is a quick and easy way to get the catalyst application up and running. this worked for me on both ubuntu and fedora.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home