Fix typos
[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
506ff3c8 7FastCGI is a high-performance extension to CGI. It is suitable for production
8environments, and is the standard method for deploying Catalyst in shared
9hosting 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
5abded07 30You can launch your application on multiple backend servers and allow
31the frontend web server to perform load-balancing among all of them. And
32of course, if one goes down, your app continues to run.
1d2376f3 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
eaeeb5e6 44=head3 Widely supported.
45
5abded07 46FastCGI is compatible with many server implementations, not just Apache.
eaeeb5e6 47
1d2376f3 48=head2 Cons
49
50You may have to disable mod_deflate. If you experience page hangs with
51mod_fastcgi then remove deflate.load and deflate.conf from mods-enabled/
52
53=head3 More complex environment
54
55With FastCGI, there are more things to monitor and more processes running
56than when using mod_perl.
57
45b58a85 58=head2 Standalone FastCGI Server
1d2376f3 59
45b58a85 60In server mode the application runs as a standalone server and accepts
61connections from a web server. The application can be on the same machine as
62the web server, on a remote machine, or even on multiple remote machines.
63Advantages of this method include running the Catalyst application as a
64different user than the web server, and the ability to set up a scalable
65server farm.
66
67To start your application in server mode, install the FCGI::ProcManager
68module and then use the included fastcgi.pl script.
69
70 $ script/myapp_fastcgi.pl -l /tmp/myapp.socket -n 5
71
72Command line options for fastcgi.pl include:
73
74 -d -daemon Daemonize the server.
75 -p -pidfile Write a pidfile with the pid of the process manager.
76 -l -listen Listen on a socket path, hostname:port, or :port.
77 -n -nproc The number of processes started to handle requests.
78
79See below for the specific web server configurations for using the external
80server.
1d2376f3 81
2d62c370 82=head1 WEB SERVERS
83
506ff3c8 84Any web server which supports FastCGI should work with Catalyst. Configuration
5336f546 85recipes for well-known web servers are linked below, and we would welcome
5abded07 86contributions from people deploying Catalyst on other web servers.
2d62c370 87
88=head2 Apache
89
90L<Catalyst::Manual::Deployment::Apache::FastCGI>
91
92=head2 nginx
93
94L<Catalyst::Manual::Deployment::nginx::FastCGI>
95
96=head2 lighttpd
97
98L<Catalyst::Manual::Deployment::lighttpd::FastCGI>
99
100=head2 Microsoft IIS
101
102L<Catalyst::Manual::Deployment::IIS::FastCGI>
103
1d2376f3 104=head1 AUTHORS
105
106Catalyst Contributors, see Catalyst.pm
107
108=head1 COPYRIGHT
109
110This library is free software. You can redistribute it and/or modify it under
111the same terms as Perl itself.
112
113=cut
114