link fixes
[catagits/Catalyst-Manual.git] / lib / Catalyst / Manual / Deployment / lighttpd / FastCGI.pod
1 =head1 NAME
2
3 Catalyst::Manual::Deployment::lighttpd::FastCGI - Deploying Catalyst with lighttpd
4
5 =head1 Lighttpd
6
7 These configurations were tested with Lighttpd 1.4.7.
8
9 =head2 Standalone server mode
10
11     server.document-root = "/var/www/MyApp/root"
12
13     fastcgi.server = (
14         "" => (
15             "MyApp" => (
16                 "socket"      => "/tmp/myapp.socket",
17                 "check-local" => "disable"
18             )
19         )
20     )
21
22 =head2 Static mode
23
24     server.document-root = "/var/www/MyApp/root"
25
26     fastcgi.server = (
27         "" => (
28             "MyApp" => (
29                 "socket"       => "/tmp/myapp.socket",
30                 "check-local"  => "disable",
31                 "bin-path"     => "/var/www/MyApp/script/myapp_fastcgi.pl",
32                 "min-procs"    => 2,
33                 "max-procs"    => 5,
34                 "idle-timeout" => 20
35             )
36         )
37     )
38
39 Note that in newer versions of lighttpd, the min-procs and idle-timeout
40 values are disabled.  The above example would start 5 processes.
41
42 =head2 Non-root configuration
43
44 You can also run your application at any non-root location with either of the
45 above modes.  Note the required mod_rewrite rule.
46
47     url.rewrite = ( "myapp\$" => "myapp/" )
48     fastcgi.server = (
49         "/myapp" => (
50             "MyApp" => (
51                 # same as above
52             )
53         )
54     )
55
56 For more information on using FastCGI under Lighttpd, visit
57 L<https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModFastCGI>
58
59
60 =head2 Static file handling
61
62 Static files can be served directly by lighttpd for a performance boost.
63
64    $HTTP["url"] !~ "^/(?:img/|static/|css/|favicon.ico$)" {
65          fastcgi.server = (
66              "" => (
67                  "MyApp" => (
68                      "socket"       => "/tmp/myapp.socket",
69                      "check-local"  => "disable",
70                  )
71              )
72          )
73     }
74
75 This will serve everything in the C<img>, C<static>, and C<css>
76 directories statically, as well as the favicon file.
77
78 =head1 AUTHORS
79
80 Catalyst Contributors, see Catalyst.pm
81
82 =head1 COPYRIGHT
83
84 This library is free software. You can redistribute it and/or modify it under
85 the same terms as Perl itself.
86
87 =cut