2 # Use this as a run script with daemontools or runit
4 ## ABSOLUTE path to the spawn-fcgi binary
5 SPAWNFCGI
="/usr/bin/spawn-fcgi"
7 ## ABSOLUTE path to the FastCGI application (php-cgi, dispatch.fcgi, ...)
8 FCGIPROGRAM
="/usr/bin/php5-cgi"
10 ## bind to unix socket
11 FCGISOCKET
="/var/run/lighttpd/your-fcgi-app.sock"
13 # allowed environment variables separated by spaces
14 ALLOWED_ENV
="PATH USER"
16 ## if this script is run as root switch to the following user
21 #RAILS_ENV="production"
25 ################## no config below this line
29 if test x
$PHP_FCGI_CHILDREN = x
; then
33 ALLOWED_ENV
="$ALLOWED_ENV RAILS_ENV"
35 if test x
$UID = x0
; then
36 EX
="$SPAWNFCGI -n -s $FCGISOCKET -u $USERID -U $SOCKUSERID -C $PHP_FCGI_CHILDREN -- $FCGIPROGRAM"
38 EX
="$SPAWNFCGI -n -s $FCGISOCKET -C $PHP_FCGI_CHILDREN -- $FCGIPROGRAM"
41 # copy the allowed environment variables
44 for i
in $ALLOWED_ENV; do
48 # clean environment and set up a new one