Expand
[catagits/Catalyst-Manual.git] / lib / Catalyst / Manual / Deployment / FastCGI.pod
CommitLineData
1d2376f3 1=head1 NAME
2
3Catalyst::Manual::Deployment::FastCGI - Deploying Catalyst with FastCGI
4
5=head1 FastCGI Deployment
6
7FastCGI is a high-performance extension to CGI. It is suitable
2d62c370 8for production environments, and is the standard method for deploying Catalyst
9in shared hosting environments.
1d2376f3 10
11=head2 Pros
12
13=head3 Speed
14
15FastCGI performs equally as well as mod_perl. Don't let the 'CGI' fool you;
16your app runs as multiple persistent processes ready to receive connections
17from the web server.
18
19=head3 App Server
20
21When using external FastCGI servers, your application runs as a standalone
22application server. It may be restarted independently from the web server.
23This allows for a more robust environment and faster reload times when
24pushing new app changes. The frontend server can even be configured to
25display a friendly "down for maintenance" page while the application is
26restarting.
27
28=head3 Load-balancing
29
30You can launch your application on multiple backend servers and allow the
31frontend web server to load-balance between all of them. And of course, if
32one goes down, your app continues to run fine.
33
34=head3 Multiple versions of the same app
35
36Each FastCGI application is a separate process, so you can run different
37versions of the same app on a single server.
38
39=head3 Can run with threaded Apache
40
41Since your app is not running inside of Apache, the faster mpm_worker module
42can be used without worrying about the thread safety of your application.
43
44=head2 Cons
45
46You may have to disable mod_deflate. If you experience page hangs with
47mod_fastcgi then remove deflate.load and deflate.conf from mods-enabled/
48
49=head3 More complex environment
50
51With FastCGI, there are more things to monitor and more processes running
52than when using mod_perl.
53
54XXX - FIXME, note not just apache!
55
45b58a85 56=head2 Standalone FastCGI Server
1d2376f3 57
45b58a85 58In server mode the application runs as a standalone server and accepts
59connections from a web server. The application can be on the same machine as
60the web server, on a remote machine, or even on multiple remote machines.
61Advantages of this method include running the Catalyst application as a
62different user than the web server, and the ability to set up a scalable
63server farm.
64
65To start your application in server mode, install the FCGI::ProcManager
66module and then use the included fastcgi.pl script.
67
68 $ script/myapp_fastcgi.pl -l /tmp/myapp.socket -n 5
69
70Command line options for fastcgi.pl include:
71
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.
76
77See below for the specific web server configurations for using the external
78server.
1d2376f3 79
2d62c370 80=head1 WEB SERVERS
81
82Any web server which supports FastCGI should work with Catalyst. Configuration recipies for
83well-known web servers are linked below, and we would welcome contributions from people
84deploying Catalyst against other web servers.
85
86=head2 Apache
87
88L<Catalyst::Manual::Deployment::Apache::FastCGI>
89
90=head2 nginx
91
92L<Catalyst::Manual::Deployment::nginx::FastCGI>
93
94=head2 lighttpd
95
96L<Catalyst::Manual::Deployment::lighttpd::FastCGI>
97
98=head2 Microsoft IIS
99
100L<Catalyst::Manual::Deployment::IIS::FastCGI>
101
1d2376f3 102=head1 AUTHORS
103
104Catalyst Contributors, see Catalyst.pm
105
106=head1 COPYRIGHT
107
108This library is free software. You can redistribute it and/or modify it under
109the same terms as Perl itself.
110
111=cut
112