Vince-
Here is a lighttpd.conf that will do exactly what you want it to do:
server.modules = (
"mod_rewrite",
"mod_redirect",
"mod_proxy",
"mod_access",
"mod_fastcgi",
"mod_compress",
"mod_accesslog" )
server.document-root = "/var/www"
server.bind = "0.0.0.0"
server.port = 80
server.pid-file = "/var/run/lighttpd.pid"
server.tag = "lighttpd"
accesslog.filename = "/var/log/lighttpd.access.log"
server.errorlog = "/var/log/lighttpd.error.log"
server.indexfiles = ( "index.php", "index.html",
"index.htm", "default.htm" )
url.access-deny = ( "~", ".inc" )
$HTTP["host"] =~ "(www\.)?example1\.com" {
accesslog.filename = "/var/log/lighttpd.php.access.log"
server.errorlog = "/var/log/lighttpd.php.error.log"
server.port = 80
server.document-root = "/var/www/"
server.indexfiles = ( "index.php", "index.html",
"index.htm", "default.htm"
)
# php-fastcgi config with it''s own php.ini.
# You must compile php with fast-cgi support
fastcgi.server = (
".php" =>
( "localhost" =>
(
"socket" =>
"/tmp/php4-fcgi.socket",
"bin-path" =>
"/usr/local/bin/php4-fcgi -
c /etc/php.ini",
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "32",
"PHP_FCGI_MAX_REQUESTS" =>
"5000"
)
)
)
)
}
# Rails site, I want this on www or no www
$HTTP["host"] =~ "(www\.)?rubyexample\.net" {
server.port = 80
server.document-root = "/var/www/test/public/"
server.error-handler-404 = "/dispatch.fcgi"
server.indexfiles = ( "index.php", "index.html",
"index.htm", "default.htm"
)
url.rewrite = ( "^/$" => "index.html",
"^([^.]+)$" => "$1.html" )
fastcgi.server = (
".fcgi" => (
"yhr_app1" => (
"socket" => "/tmp/lighttpd-fcgi1.socket",
"bin-environment" => ( "RAILS_ENV" =>
"development" ),
"bin-path" =>
"/var/www/test/public/dispatch.fcgi",
"max-load-per-proc" => 4,
"min-procs" => 1,
"max-procs" => 2,
"idle-timeout" => 60
)
)
)
}
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" => "audio/x-wav",
".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",
".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"
)
Cheers-
-Ezra Zygmuntowicz
Yakima Herald-Republic
WebMaster
http://yakimaherald.com
509-577-7732
ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org