Project

General

Profile

Fastcgi on lighttpd » History » Revision 2

Revision 1 (Pieter Libin, 10/29/2009 02:38 PM) → Revision 2/8 (Pieter Libin, 10/29/2009 02:39 PM)

h1. Fastcgi on lighttpd 

 {{toc}} 


 h3. Opensuse config  

 * On Opensuse the lighttpd is in the factory tree at repos.opensuse.org 
   
 : http://repos.opensuse.org:/http/SUSE_Linux_10.1/i586/lighttpd-1.4.15-6.1.i586.rpm 
 * Store the wt application in /srv/www/cgi-bin 
  
 : /srv/www/cgi-bin/helloworld.fcgi 
 * Opensuse lighttpd configs are modular - create a new file /etc/lighttpd/conf.d/helloworld.conf 
 <pre> <pre><nowiki> 
 fastcgi.server += ("/helloworld" => 
 <pre> 
                    ("helloworld" => 
                      ("socket" => "/usr/wt/socket", 
                       "bin-path" => "/srv/www/cgi-bin/helloworld.fcgi", 
                       "max-procs" => 1, 
                       "check-local" => "disable", 
                       "bin-environment" => ("FOO" => "bar") 
                      ) 
                     ) 
                 ) 
 </pre> 
 </nowiki></pre> 
 * in /etc/lighttpd/modules.conf 
  
 : enable the following (existing) section 
 <pre> <pre><nowiki> 
 ## 
 ## FastCGI (mod_fastcgi) 
 ## 
 include "conf.d/fastcgi.conf" 
 </pre> </nowiki></pre> 
 : append an include line at the end of the modules.conf file 
 <pre> <pre><nowiki> 
 include "conf.d/helloworld.conf" 
 </pre> </nowiki></pre> 

 * When done you can access the application on htpp://your.server/helloworld 

 h3. Flat File Config  

 If you have a single config file, add such a section 
 <pre> <pre><nowiki> 
 server.modules += ( "mod_fastcgi" ) 
 fastcgi.server += ("/helloworld" => 
 <pre> 
                    ("helloworld" => 
                      ("socket" => "/usr/wt/socket", 
                       "bin-path" => "/srv/www/cgi-bin/helloworld.fcgi", 
                       "max-procs" => 1, 
                       "check-local" => "disable", 
                       "bin-environment" => ("FOO" => "bar") 
                      ) 
                     ) 
                 ) 
 </pre> 
 </nowiki></pre> 
 * When done you can access the application on htpp://your.server/helloworld 


 h3. /usr/wt  

 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).