Skip to content

Instantly share code, notes, and snippets.

@seabre
Created November 4, 2011 15:53
Show Gist options
  • Save seabre/1339668 to your computer and use it in GitHub Desktop.
Save seabre/1339668 to your computer and use it in GitHub Desktop.
lighttpd PHP Demo Server Configuration
# I needed a way to quickly test PHP stuff without setting it up somewhere in Apache.
# This works great. You can keep this in your repo and whenever you want to run your code do:
# lighttpd -f lighttpd.conf
# from the root and off you go.
server.bind = "0.0.0.0"
server.port = 8000
server.document-root = CWD
server.errorlog = CWD + "/logs/lighttpd.error.log"
accesslog.filename = CWD + "/logs/lighttpd.access.log"
index-file.names = ( "index.php", "index.html",
"index.htm", "default.htm" )
server.modules = ("mod_fastcgi", "mod_accesslog")
fastcgi.server = ( ".php" => ((
"bin-path" => "/usr/bin/php-cgi",
"socket" => CWD + "/php5.socket",
)))
mimetype.assign = (
".css" => "text/css",
".gif" => "image/gif",
".htm" => "text/html",
".html" => "text/html",
".jpeg" => "image/jpeg",
".jpg" => "image/jpeg",
".js" => "text/javascript",
".png" => "image/png",
".swf" => "application/x-shockwave-flash",
".txt" => "text/plain"
)
# Making sure file uploads above 64k always work when using IE or Safari
# For more information, see http://trac.lighttpd.net/trac/ticket/360
$HTTP["useragent"] =~ "^(.*MSIE.*)|(.*AppleWebKit.*)$" {
server.max-keep-alive-requests = 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment