Skip to content

Instantly share code, notes, and snippets.

@electblake
Last active March 13, 2019 13:05
Show Gist options
  • Save electblake/6663920 to your computer and use it in GitHub Desktop.
Save electblake/6663920 to your computer and use it in GitHub Desktop.
lighttpd.conf - Laravel 4 (php5 + homebrew)
# lighttpd -D -f conf/lighttpd.conf
server.document-root = "/path/to/webroot"
server.port = 8080
#server.username = "username"
#server.groupname = "password"
static-file.exclude-extensions = ( ".fcgi", ".php", ".rb", "~", ".inc" )
index-file.names = ( "index.html", "index.php", "server.php" )
server.modules= (
"mod_alias",
"mod_access",
"mod_accesslog",
"mod_fastcgi",
"mod_redirect",
"mod_rewrite"
# "mod_setenv"
# "mod_simple_vhost"
)
mimetype.assign = (
".pdf" => "application/pdf",
".sig" => "application/pgp-signature",
".spl" => "application/futuresplash",
".class" => "application/octet-stream",
".ps" => "application/postscript",
".torrent" => "application/x-bittorrent",
".dvi" => "application/x-dvi",
".gz" => "application/x-gzip",
".pac" => "application/x-ns-proxy-autoconfig",
".swf" => "application/x-shockwave-flash",
".tar.gz" => "application/x-tgz",
".tgz" => "application/x-tgz",
".tar" => "application/x-tar",
".zip" => "application/zip",
".mp3" => "audio/mpeg",
".m3u" => "audio/x-mpegurl",
".wma" => "audio/x-ms-wma",
".wax" => "audio/x-ms-wax",
".ogg" => "application/ogg",
".wav" => "audio/x-wav",
".gif" => "image/gif",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".png" => "image/png",
".xbm" => "image/x-xbitmap",
".xpm" => "image/x-xpixmap",
".xwd" => "image/x-xwindowdump",
".css" => "text/css",
".html" => "text/html",
".htm" => "text/html",
".js" => "text/javascript",
".asc" => "text/plain",
".c" => "text/plain",
".cpp" => "text/plain",
".log" => "text/plain",
".conf" => "text/plain",
".text" => "text/plain",
".txt" => "text/plain",
".dtd" => "text/xml",
".xml" => "text/xml",
".mpeg" => "video/mpeg",
".mpg" => "video/mpeg",
".mov" => "video/quicktime",
".qt" => "video/quicktime",
".avi" => "video/x-msvideo",
".asf" => "video/x-ms-asf",
".asx" => "video/x-ms-asf",
".wmv" => "video/x-ms-wmv",
".bz2" => "application/x-bzip",
".tbz" => "application/x-bzip-compressed-tar",
".tar.bz2" => "application/x-bzip-compressed-tar"
)
## Logs
#accesslog.filename = "./app/storage/logs/lighttpd-access.log"
#server.errorlog = "./app/storage/logs/lighttpd-erorr.log"
## PHP/FastCGI
fastcgi.debug = 0
fastcgi.server = (
".php" =>
(( "max-procs" => 1,
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "16",
"PHP_FCGI_MAX_REQUESTS" => "10000"
),
"broken-scriptfilename" => "enable",
"bin-path" => "/usr/local/php5/bin/php-cgi",
"socket" => "/tmp/php.socket",
))
)
## Hosts
$HTTP["host"] =~ "yourhost.dev:[0-9]+$" {
server.document-root = "/path/to/dist/public"
accesslog.filename = "/path/to/dist/app/storage/logs/lighttpd-access.log"
alias.url = ()
url.redirect = ()
url.rewrite-if-not-file = (
"^/(css|img|js)/.*\.(jpg|jpeg|gif|png|swf|avi|mpg|mpeg|mp3|flv|ico|css|js)$" => "$0",
"^/(favicon\.ico|robots\.txt|sitemap\.xml)$" => "$0",
"^/[^\?]*(\?.*)?$" => "index.php/$1"
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment