Project

General

Profile

Fastcgi on lighttpd » History » Version 1

Pieter Libin, 10/29/2009 02:38 PM

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
: http://repos.opensuse.org:/http/SUSE_Linux_10.1/i586/lighttpd-1.4.15-6.1.i586.rpm
10
* Store the wt application in /srv/www/cgi-bin
11
: /srv/www/cgi-bin/helloworld.fcgi
12
* Opensuse lighttpd configs are modular - create a new file /etc/lighttpd/conf.d/helloworld.conf
13
<pre><nowiki>
14
fastcgi.server += ("/helloworld" =>
15
<pre>
16
                   ("helloworld" =>
17
                     ("socket" => "/usr/wt/socket",
18
                      "bin-path" => "/srv/www/cgi-bin/helloworld.fcgi",
19
                      "max-procs" => 1,
20
                      "check-local" => "disable",
21
                      "bin-environment" => ("FOO" => "bar")
22
                     )
23
                    )
24
                )
25
</pre>
26
</nowiki></pre>
27
* in /etc/lighttpd/modules.conf
28
: enable the following (existing) section
29
<pre><nowiki>
30
##
31
## FastCGI (mod_fastcgi)
32
##
33
include "conf.d/fastcgi.conf"
34
</nowiki></pre>
35
: append an include line at the end of the modules.conf file
36
<pre><nowiki>
37
include "conf.d/helloworld.conf"
38
</nowiki></pre>
39
40
* When done you can access the application on htpp://your.server/helloworld
41
42
h3. Flat File Config 
43
44
If you have a single config file, add such a section
45
<pre><nowiki>
46
server.modules += ( "mod_fastcgi" )
47
fastcgi.server += ("/helloworld" =>
48
<pre>
49
                   ("helloworld" =>
50
                     ("socket" => "/usr/wt/socket",
51
                      "bin-path" => "/srv/www/cgi-bin/helloworld.fcgi",
52
                      "max-procs" => 1,
53
                      "check-local" => "disable",
54
                      "bin-environment" => ("FOO" => "bar")
55
                     )
56
                    )
57
                )
58
</pre>
59
</nowiki></pre>
60
* When done you can access the application on htpp://your.server/helloworld
61
62
63
h3. /usr/wt 
64
65
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).