Deployment question: running multiple applications using sym


#1

Hi,

I’m looking to run several installation of a rails app. Each one has
certain unique elements, like database.yml some and some css stuff,
possible some templates as well.

I’ve set this up like

/w/sites/clienta
/w/sites/clientb
/w/sites/clientc

Inside these directories there will be mostly symlinks to:

/apps/myapp

Urls for these apps will be:

http://clienta.example.com
http://clientb.example.com
http://clientc.example.com

Is it best to have each installation have it’s own public/dispatch.fcgi
? Or should I symlink them to /apps/myapp/public/dispatch.fcgi?
If I give them their own socket it shouldn’t matter and I can just
symlink them, right?

Also, what is the preferred way to setup lighty? I’ve got this so far,
and it’s working, only switchtower can never find any running processes
so the rake deploy doesn’t fully work because I still have to restart
the server manually…

$HTTP[“host”] == var.appname {
server.document-root = “/w/sites/” + var.appname + “/public/”
url.rewrite = ( “^/$” => “index.html”, “^([^.]+)$” => “$1.html” )
server.error-handler-404 = “/dispatch.fcgi”
fastcgi.server = ( “.fcgi” =>
( “localhost” =>
( “min-procs” => 1,
“max-procs” => 4,
“socket” => “/tmp/” + var.appname + “.socket”,
“bin-path” => “/w/sites/” + var.appname +
“/public/dispatch.fcgi”,
“bin-environment” => ( “RAILS_ENV” => “production” )
)
)
)
}

Can anybody comment on this setup?

Jeroen