Tuesday, July 28, 2009

Catalyst FastCGI in a directory

This configuration allows you to have multiple applications run separately from a single Lighttpd instance, by dispatching to them based on the root directory.

This way it's easier to update single parts, and debug them separately.


#----------------------------------------------------------------------------
# this is a lighttpd configuration file for a Catalyst FCGI application
# that lives within a directory
#----------------------------------------------------------------------------

#-----------------------------------------
# ensure there's always a trailing slash
#-----------------------------------------
url.rewrite-once = (
"^/(skunky)$" => "/$1/",
)

#-----------------------------------------
# forward requests to the FCGI server
#-----------------------------------------
$HTTP["url"] =~ "^/skunky" {
alias.url = (
# app-specific favicon (does this work?)
"/favicon.ico" => "/var/www/Skunky/favicon.ico",
# standard js
"/js/" => "/var/www/js/",
# app-specific css
"/css/" => "/var/www/Skunky/css/",
)

# fcgi - does not rewrite the script name
fastcgi.server = (
"/skunky" => (
( "host" => "127.0.0.1", "port" => 3012, "check-local" => "disable"),
)
)
}

No comments: