All pastes #28376 Raw Edit

Mine

public text v1 · immutable
#28376 ·published 2005-11-11 16:23 UTC
rendered paste body
# lighttpd configuration file
# 
# use a it as base for lighttpd 1.0.0 and above
#
# $Id: lighttpd.conf,v 1.7 2004/11/03 22:26:05 weigon Exp $

############ Options you really have to take care of ####################

## modules to load
# at least mod_access and mod_accesslog should be loaded
# all other module should only be loaded if really neccesary
# - saves some time
# - saves memory                              
server.modules              = (
#<<<mod_rewrite needs to be enabled>>>
                               "mod_rewrite",
#                               "mod_redirect", 
                    "mod_access",
#               "mod_auth", 
#                               "mod_status", 
#<<<mod_fastcgi needs to be enabled>>>
                "mod_fastcgi",
#               "mod_simple_vhost",
#               "mod_evhost",
#               "mod_cgi",
#               "mod_compress",
#                               "mod_ssi",
#                               "mod_usertrack",
#               "mod_rrdtool",
                "mod_accesslog" )

## a static document-root, for virtual-hosting take look at the 
## server.virtual-* options
#<<<Set to full path to your $RAILS_ROOT/public>>>
server.document-root             = "/var/www/jeanjacques/test/public/"

## where to send error-messages to
#<<<Set to full path to your $RAILS_ROOT/log/lighttpd.error.log>>>
server.errorlog            = "/var/www/jeanjacques/test/lighttpd.error.log"

# files to check for if .../ is requested
server.indexfiles          = ( "index.php", "index.html",
                                "index.htm", "default.htm" )
--- SNIP ---

#### accesslog module
#<<<Full path to $RAILS_ROOT/log/access.log>>>
accesslog.filename          = "/var/www/jeanjacques/test/log/access.log"

## deny access the file-extensions
#
# ~    is for backupfiles from vi, emacs, joe, ...
# .inc is often used for code includes which should in general not be part
#      of the document-root
url.access-deny             = ( "~", ".inc" )



######### Options that are good to be but not neccesary to be changed #######

## bind to port (default: 80)
#<<<Must set this to a high port (>1024) so your regular user can open the socket
server.port                = 8888

## bind to localhost (default: all interfaces)
#<<<Set to 127.0.0.1 for now, uncomment to listen on all interfaces later>>>
server.bind                = "127.0.0.1"

--- SNIP ---

#<<<Comment out all of these, they only apply to root>>>
### only root can use these options
#
# chroot() to directory (default: no chroot() )
#server.chroot            = "/"

## change uid to <uid> (default: don't care)
#server.username            = "wwwuser"

## change uid to <uid> (default: don't care)
#server.groupname           = "wwwgroup"

#### compress module
#compress.cache-dir          = "/var/tmp/lighttpd/cache/compress/"
#compress.filetype           = ("text/plain", "text/html")

#### fastcgi module
## read fastcgi.txt for more info
#<<<Here is the dirty work, feel free to eliminate the .php entry if you don't need it>>>
#<<<for the php4 entry to work you need to 'apt-get install php4-cgi'>>>
#<<<bin-path should be the full path to $RAILS_ROOT/public/dispatch.fcgi>>>
#<<<you can spawn multiple fastcgi processes, 5 is a good starting point>>>
fastcgi.server = ( 
		".fcgi" =>
                    ( "localhost" =>
                        (
                            "socket" => "/tmp/rails.socket",
                            "bin-path" => "/var/www/jeanjacques/test/public/dispatch.fcgi"
                        )
                    ),
                    ( "localhost" =>
                        (
                            "socket" => "/tmp/rails1.socket",
                            "bin-path" => "/var/www/jeanjacques/test/public/dispatch.fcgi"
                        )
                    ),
                    ( "localhost" =>
                        (
                            "socket" => "/tmp/rails2.socket",
                            "bin-path" => "/var/www/jeanjacques/test/public/dispatch.fcgi"
                        )
                    ),
                    ( "localhost" =>
                        (
                            "socket" => "/tmp/rails3.socket",
                            "bin-path" => "/var/www/jeanjacques/public/dispatch.fcgi"
                        )
                    ),
                    ( "localhost" =>
                        (
                            "socket" => "/tmp/rails4.socket",
                            "bin-path" => "/var/www/jeanjacques/public/dispatch.fcgi"
                        )
                    ),
		".php" =>
                    ( "localhost" =>
                        (
                            "socket" => "/tmp/php-fcgi.socket",
                            "bin-path" => "/usr/bin/php4-cgi"
                        )
                    )
                 )

--- SNIP ---

#### url handling modules (rewrite, redirect, access)
# url.rewrite                 = ( "^/$"             => "/server-status" )
# url.redirect                = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
#<<<Url rewriting for pretty urls>>>
#<<<You'll need to set the first one to your default controller and action, replacing>>>
#<<<controller=home&action=index2 with your chosen controller and action>>>
url.rewrite = ( 
			"^/$" =>  "/dispatch.fcgi?controller=home&action=index2",
			"^/([\-_a-zA-Z0-9]+)/([\-_a-zA-Z0-9]+)/([\-_a-zA-Z0-9%]+)\??([\-_a-zA-Z0-9=&%]*)$"  => 
				"/dispatch.fcgi?controller=$1&action=$2&id=$3&$4",
			"^/([\-_a-zA-Z0-9]+)/([\-_a-zA-Z0-9]+)/?\??([\-_a-zA-Z0-9=&%]*)$"  => 
				"/dispatch.fcgi?controller=$1&action=$2&$3",
			"^/([\-_a-zA-Z0-9]+)/?\??([\-_a-zA-Z0-9=&%]*)$"  =>  
				"/dispatch.fcgi?controller=$1&action=index&$2"
)


-- SNIP ---