Lighttpd Virtual Hosts with SCGI on Windows
06/02/27
To get Lighttpd working follow the instructions on the rails wiki
After you get it working with one host modify your lighttpd.conf and your scgi.yaml files to look something like the files below.
//lighttpd.conf
server.document-root = "C:/apps/app1/public"
server.modules = (
"mod_rewrite",
"mod_redirect",
"mod_access",
"mod_accesslog",
"mod_status",
"mod_scgi")
var.app1 = "C:/apps/app1"
$HTTP["host"] == "www.app1.com" {
server.document-root = var.app1 + "/public"
server.errorlog = var.app1 + "/log/lighttpd-errors.log"
accesslog.filename = var.app1 + "/log/lighttpd-access.log"
static-file.exclude-extensions = ( ".fcgi", ".scgi" )
server.error-handler-404 = "/dispatch.scgi"
scgi.server = ( "dispatch.scgi" => ((
"host" => "127.0.0.1",
"port" => 9999,
"check-local" => "disable"
)) )
}
var.app2 = "C:/apps/app2"
$HTTP["host"] == "www.app2.com" {
server.document-root = var.app2 + "/public"
server.errorlog = var.app2 + "/log/lighttpd-errors.log"
accesslog.filename = var.app2 + "/log/lighttpd-access.log"
static-file.exclude-extensions = ( ".fcgi", ".scgi" )
server.error-handler-404 = "/dispatch.scgi"
scgi.server = ( "dispatch.scgi" => ((
"host" => "127.0.0.1",
"port" => 9998,
"check-local" => "disable"
)) )
}
scgi.debug=0
status.status-url = "/server-status"
status.config-url = "/server-config"
The mime types were left off, but you will need to inculde them in your config.
Here are the scgi.yaml files that you will also need to have as well.
#C:/apps/app1/config/scgi.yaml
:host: 127.0.0.1
:password: ***********
:port: 9999
:logfile: log/scgi.log
:config: config/scgi.yaml
:control_url: druby://127.0.0.1:8999
:disable_signals: true
:env: production
#C:/apps/app2/config/scgi.yaml
:host: 127.0.0.1
:password: ***********
:port: 9998
:logfile: log/scgi.log
:config: config/scgi.yaml
:control_url: druby://127.0.0.1:8998
:disable_signals: true
:env: production
Comments