lighttpd_fcgi.conf 2.37 KB
# -*- Mode: Conf; tab-width: 4; indent-tabs-mode: nil; -*-
# vim:set ft=conf ts=4 sw=4 sts=4 autoindent:

# Example configuration for hosting brat using LigHTTPD and FastCGI.
#
# Author:   Pontus Stenetorp    <pontus stenetorp se>
# Version:  2011-08-21

# Import the FastCGI module (Don't touch this!)
server.modules += ( "mod_fastcgi" )

### Mandatory parameters
server.document-root = CHANGE_ME

### Might-be-interesting parameters
#server.username     = "www-data"
#server.groupname    = "www-data"
server.port         = 4711
# We put the log by default into the brat work directory
server.errorlog     = server.document-root + "/work/lighttpd_fcgi_error.log"
server.pid-file    = server.document-root + "/work/lighttpd_fcgi.pid"
fastcgi.debug       = 0

### Most-likely-not-interesting parameters
index-file.names = ( "index.html" )

# NOTE: Keep this filled not to serve non-sense
static-file.exclude-extensions = ( ".fcgi", "~", ".cgi", ".py", ".pyc",
    ".htaccess", ".gitignore" )

# Re-write URL;s directed at the CGI script to FastCGI
server.modules += ( "mod_rewrite" )
url.rewrite-once = (
    "^/ajax.cgi"  => "/ajax.fcgi",
    )

# Configure FastCGI
fastcgi.server = ( "/ajax.fcgi" =>
 ((
    "bin-path" => server.document-root + "/ajax.fcgi",
    "socket" => server.document-root + "/work/lighttpd_fastcgi.socket",
    # Only allow a single process to serve requests for now
    "max-procs" => 16,
    # Don't check in the local filesystem for a file with the same name as
    # the script
    "check-local" => "disable"
 ))
 )

# Mime type mappings
mimetype.assign = (
  ".jpg" 	=> "image/jpeg",
  ".jpeg"   => "image/jpeg",
  ".png" 	=> "image/png",
  ".gif"    => "image/gif",
  ".pdf"    => "application/pdf",
  ".svg"    => "image/svg+xml",

  ".xhtml" 	=> "application/xhtml+xml",
  ".html" 	=> "text/html", 
  ".htm"    => "text/html",
  ".xml"    => "text/xml",
  ".txt" 	=> "text/plain",

  ".js"     => "text/javascript",
  ".css"   	=> "text/css",
  ".ttf" 	=> "font/ttf",

  ".zip"    => "application/zip",
  ".tar"    => "application/x-tar",
  ".gz"     => "application/x-gzip",
  ".tar.gz" => "application/x-tgz",
  ".tgz"    => "application/x-tgz",
  ".bz2"    => "application/x-bzip",
  ".tbz"    => "application/x-bzip-compressed-tar",
  ".tar.bz2"=> "application/x-bzip-compressed-tar",

# make the default mime type application/octet-stream
  ""        => "application/octet-stream",
)