Project

General

Profile

Fastcgi on lighttpd » History » Version 8

Peter Mortensen, 04/15/2011 10:52 PM
According to <http://en.wikipedia.org/wiki/OpenSUSE>.

1 7 Peter Mortensen
h1. FastCGI on lighttpd
2 1 Pieter Libin
3
{{toc}}
4
5
6 8 Peter Mortensen
h3. openSUSE configuration
7 1 Pieter Libin
8 8 Peter Mortensen
* 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 8 Peter Mortensen
* The openSUSE lighttpd configuration 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 7 Peter Mortensen
h3. Flat File Configuration 
41 1 Pieter Libin
42 7 Peter Mortensen
If you have a single configuration 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 7 Peter Mortensen
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).