[Catalyst] How to use fastcgi

Mike Raynham catalyst at mikeraynham.co.uk
Sat Mar 19 08:46:01 GMT 2011

On 19/03/11 03:24, John M. Dlugosz wrote:
> I've set up my app on an Apache server using fastcgi. Following the
> instructions in the "cookbook" and a few other places, The Virtual
> Server block looks something like this:
> ServerName www.ClientsDomainName.com
> ServerAlias CLientID.dlugosz.com
> ServerAlias ClientID.LocalCloneOfServer
> # Serve static content directly
> DocumentRoot "/var/www/MyApp/MyApp-0.01/root"
> Alias /static /var/www/MyApp/MyApp-0.01/root/static
> ErrorLog /var/www/MyApp/MyApp-0.01/logs/error_log
> CustomLog /var/www/MyApp/MyApp-0.01/logs/access_log combined
> FastCgiServer /var/www/MyApp/MyApp-0.01/script/MyApp_fastcgi.pl
> -processes 3
> Alias / /var/www/MyApp/MyApp-0.01/script/MyApp_fastcgi.pl/
> I went with unpacking the archive within a base directory of the same
> name, so that the base directory can be given permissions different from
> the main www directory.
> Any more suggestions and tips thus far?
> My question at this point concerns reloading and cycling of the fastcgi
> server. If I update the app's files, how do I reload it? I didn't see
> any feature similar to the -r on the development server. Looking at the
> process list, I see lots of Apache2 processes, none named fastcgi. I'm
> guessing that the "fork" done by Apache doesn't change the process name
> and command-line identification? So I can't just kill them off because I
> don't know which ones they are!
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/

Your application is configured to run in static mode.  In static mode, 
FastCGI applications are spawned and managed by the FastCGI Process 
Manager (fcgi-pm).  Restarting Apache will restart the fcgi-pm, which in 
turn will restart your application.

You may also want to consider running your application in external mode, 
which will give you more control.  I answered a similar question a few 
days ago, and gave some configuration examples there:




More information about the Catalyst mailing list