what if you have multiple apps?
Will have you have to keep track of ports?
Here is a snippet from my lightty config:
$HTTP[“host”] == “demo3023.djdossiers.com” {
server.document-root = “/sites/djd_sites/demo/demo_3023/public/”
server.error-handler-404 = “/dispatch.fcgi”
server.indexfiles = ( “dispatch.fcgi”, “index.html”)
accesslog.format = “%h %l %u %t "%r" %>s %b "%{Referer}i"
"%{User-agent}i"”
server.errorlog =
“/sites/djd_sites/demo/demo_3023/log/lighttpd.error.log”
accesslog.filename =
“/sites/djd_sites/demo/demo_3023/log/lighttpd.access.log”
fastcgi.server = ( “.fcgi” =>
( “demo_3023_djdossiers.com” =>
( “socket” => “/tmp/demo_3023_djdossiers.socket”,
“min-procs” => 1,
“max-procs” => 1,
“bin-path” =>
“/sites/djd_sites/demo/demo_3023/public/dispatch.fcgi”,
“bin-environment” => ( “RAILS_ENV” => “production” ))
))
}
how would i use the spawner script in that instance? Also, When I add a
new demo or account, will i have to restart light because of the
additional http snippet that will need to be added?
thanks
jake
Subimage Interactive wrote:
Jake, you want to use Lighttpd/FCGI to get this done…Apache/FCGI will
not
work for this kind of a setup. I hear mongrel works well also, but I
haven’t
done a deployment using mongrel just yet. I just went through such a
thing
so hopefully this helps you out a little.
The magic is in Lighty’s fastcgi.server setup…here’s a copy of mine
from a
deployment I’ve done…
fastcgi.server = ( “.fcgi” =>
(“edeals-7000” => ( “host” => “127.0.0.1”, “port” => 7000 ) ),
(“edeals-7001” => ( “host” => “127.0.0.1”, “port” => 7001 ) ),
(“edeals-7002” => ( “host” => “127.0.0.1”, “port” => 7002 ) ),
(“edeals-7003” => ( “host” => “127.0.0.1”, “port” => 7003 ) )
)
It proxies requests to the selected ports set up here. This way you can
restart your fcgi servers by doing the following from your capistrano
restart task.
run “#{release_path}/script/process/killer”
run “#{release_path}/script/process/spawner -p 7000 -i 4 -r 60 -d
#{release_path}/public/dispatch.fcgi”
I have spawner set up to restart fallen down processes every 60 seconds,
so
the built in reaper script doesn’t do me much good. I’ve written a
‘killer’
script that stops the daemon as well as the fcgis before I
re-spawn…here
it is included:
#!/bin/sh
Kill all spawner processes
ps auxw | grep spawner | grep deploy | awk ‘{print $2}’ | xargs kill -9;
Kill all dispatch processes
ps auxw | grep dispatch | grep deploy | awk ‘{print $2}’ | xargs kill
-9;
exit 0;
‘deploy’ is my username that the application is running under. You will
want
to change this depending on your setup / users.
Hope that helped a little…
On 12/14/06, Jake V. [email protected] wrote:
–
Posted via http://www.ruby-forum.com/.
–
seth at subimage interactive
http://www.subimage.com/sublog/