3 Catalyst::Manual::Deployment::FastCGI - Deploying Catalyst with FastCGI
5 =head1 FastCGI Deployment
7 FastCGI is a high-performance extension to CGI. It is suitable
8 for production environments, and is the standard method for deploying Catalyst
9 in shared hosting environments.
15 FastCGI performs equally as well as mod_perl. Don't let the 'CGI' fool you;
16 your app runs as multiple persistent processes ready to receive connections
21 When using external FastCGI servers, your application runs as a standalone
22 application server. It may be restarted independently from the web server.
23 This allows for a more robust environment and faster reload times when
24 pushing new app changes. The frontend server can even be configured to
25 display a friendly "down for maintenance" page while the application is
30 You can launch your application on multiple backend servers and allow the
31 frontend web server to load-balance between all of them. And of course, if
32 one goes down, your app continues to run fine.
34 =head3 Multiple versions of the same app
36 Each FastCGI application is a separate process, so you can run different
37 versions of the same app on a single server.
39 =head3 Can run with threaded Apache
41 Since your app is not running inside of Apache, the faster mpm_worker module
42 can be used without worrying about the thread safety of your application.
46 You may have to disable mod_deflate. If you experience page hangs with
47 mod_fastcgi then remove deflate.load and deflate.conf from mods-enabled/
49 =head3 More complex environment
51 With FastCGI, there are more things to monitor and more processes running
52 than when using mod_perl.
54 XXX - FIXME, note not just apache!
56 =head2 Standalone FastCGI Server
58 In server mode the application runs as a standalone server and accepts
59 connections from a web server. The application can be on the same machine as
60 the web server, on a remote machine, or even on multiple remote machines.
61 Advantages of this method include running the Catalyst application as a
62 different user than the web server, and the ability to set up a scalable
65 To start your application in server mode, install the FCGI::ProcManager
66 module and then use the included fastcgi.pl script.
68 $ script/myapp_fastcgi.pl -l /tmp/myapp.socket -n 5
70 Command line options for fastcgi.pl include:
72 -d -daemon Daemonize the server.
73 -p -pidfile Write a pidfile with the pid of the process manager.
74 -l -listen Listen on a socket path, hostname:port, or :port.
75 -n -nproc The number of processes started to handle requests.
77 See below for the specific web server configurations for using the external
82 Any web server which supports FastCGI should work with Catalyst. Configuration recipies for
83 well-known web servers are linked below, and we would welcome contributions from people
84 deploying Catalyst against other web servers.
88 L<Catalyst::Manual::Deployment::Apache::FastCGI>
92 L<Catalyst::Manual::Deployment::nginx::FastCGI>
96 L<Catalyst::Manual::Deployment::lighttpd::FastCGI>
100 L<Catalyst::Manual::Deployment::IIS::FastCGI>
104 Catalyst Contributors, see Catalyst.pm
108 This library is free software. You can redistribute it and/or modify it under
109 the same terms as Perl itself.