This is a minor Linux administrative issue having to do with deploying
rails applications. I am considering where to place the root of our
rails application and I would appreciate some suggestions, along with
supporting rationale, from those of you that have deployed a rails
appliction for general enterprise use. I am thinking along the lines of
using “/opt/ruby/rails/” or some variation on this but I
thought that I would ask first and see if there exists a concensus on
where these things should be placed.
The environments that I need to consider are these:
Prototype and Initial release: Rails Application + Apache 2 +
PostgreSQL 8.1 all on one machine.
Possible future deployment: Rails Application + Apache 2 + mod_fcgid on
one or more machines, PostgreSQL on a second.
It is also possible, albeit unlikely, that more than one rails
application will be deployed on a single machine, accepting the
constraints that special measures are needed to effect this
configuration safely.
Regards,
Jim
I would use /var/www/rails/ as the container for Rails apps being
deployed under Linux w/Apache2. This would be analogous to using
/var/www/perl-bin for mod_perl apps. But I can certainly see how /opt
would seem like a good place, as well.
If you have more than one user that needs to deploy Rails apps on your
server, then I would amend the above to be /var/www/rails/, for
each user’s Rails apps. However, to make that really work, I think you
would need to use LightTPD, so you could spawn independent LightTPD
processes for each user, thus giving them their own FastCGI listeners
that they could then control through ./script/process/reaper.
-Brian
If you have more than one user that needs to deploy Rails apps on
your
server, then I would
recommend webapp-config, nee http://www.vhost-tools.org
which makes deploying multiple versions of apps in multiple locations
for multiple users…much easier. Capistrano’s second cousin, Medusa…
unfortunately it didnt catch the bug that i just found in collaboa where
it gets stuck in and endless loop rolling back the changeset synchs over
and over causing each request to take 45 seconds, but thats another
story…
On Mar 6, 2006, at 6:20 AM, James B. wrote:
This is a minor Linux administrative issue having to do with deploying
rails applications. I am considering where to place the root of our
rails application and I would appreciate some suggestions, along with
supporting rationale, from those of you that have deployed a rails
appliction for general enterprise use.
snip…
Possible future deployment: Rails Application + Apache 2 +
mod_fcgid on
one or more machines, PostgreSQL on a second.
I just completed such a rollout last week.
We created a user with strictly controlled permissions on all the
machines,
and put the code in the home directory of the application user.
It makes sense to me as applications run as a user, why not have a user
to run the application? The security setup is easy, and it’s easy to
keep
track of that the app is doing under top, etc.
–
– Tom M.