Project

General

Profile

Fastcgi on lighttpd » History » Version 6

Koen Deforche, 05/27/2010 07:06 AM

1 1 Pieter Libin
h1. Fastcgi on lighttpd
2
3
{{toc}}
4
5
6
h3. Opensuse config 
7
8
* On Opensuse the lighttpd is in the factory tree at repos.opensuse.org
9 2 Pieter Libin
  http://repos.opensuse.org:/http/SUSE_Linux_10.1/i586/lighttpd-1.4.15-6.1.i586.rpm
10 1 Pieter Libin
* Store the wt application in /srv/www/cgi-bin
11 2 Pieter Libin
 /srv/www/cgi-bin/helloworld.fcgi
12 1 Pieter Libin
* Opensuse lighttpd configs are modular - create a new file /etc/lighttpd/conf.d/helloworld.conf
13 3 Pieter Libin
 <pre>
14 2 Pieter Libin
fastcgi.server += ("/helloworld" =>
15 1 Pieter Libin
                   ("helloworld" =>
16
                     ("socket" => "/usr/wt/socket",
17
                      "bin-path" => "/srv/www/cgi-bin/helloworld.fcgi",
18
                      "max-procs" => 1,
19
                      "check-local" => "disable",
20
                      "bin-environment" => ("FOO" => "bar")
21
                     )
22
                    )
23
                )
24 3 Pieter Libin
 </pre>
25 1 Pieter Libin
* in /etc/lighttpd/modules.conf
26 2 Pieter Libin
 enable the following (existing) section
27 3 Pieter Libin
 <pre>
28 1 Pieter Libin
##
29
## FastCGI (mod_fastcgi)
30
##
31
include "conf.d/fastcgi.conf"
32 3 Pieter Libin
 </pre>
33 4 Pieter Libin
 append an include line at the end of the modules.conf file
34 3 Pieter Libin
 <pre>
35 1 Pieter Libin
include "conf.d/helloworld.conf"
36 3 Pieter Libin
 </pre>
37 1 Pieter Libin
38
* When done you can access the application on htpp://your.server/helloworld
39
40
h3. Flat File Config 
41
42
If you have a single config file, add such a section
43 3 Pieter Libin
 <pre>
44 1 Pieter Libin
server.modules += ( "mod_fastcgi" )
45
fastcgi.server += ("/helloworld" =>
46
                   ("helloworld" =>
47
                     ("socket" => "/usr/wt/socket",
48
                      "bin-path" => "/srv/www/cgi-bin/helloworld.fcgi",
49
                      "max-procs" => 1,
50
                      "check-local" => "disable",
51
                      "bin-environment" => ("FOO" => "bar")
52
                     )
53
                    )
54
                )
55 3 Pieter Libin
 </pre>
56 1 Pieter Libin
* When done you can access the application on htpp://your.server/helloworld
57
58
59
h3. /usr/wt 
60
61
The fastcgi socket has been put into /usr/wt/socket because the default wt build does put its own session server sockets as $prefix/wt/run/server-$X. There is no requirement to let the lighttpd precreate fastcgi wt servers to handle different connections as wt will schedule server creation and session scheduling internally. The internal creation of session servers is not logged to httpd log (where it should be).