My goal is to run ruby applications under different server users with potentially different versions of ruby.
So i would have users that serve as the "hosting account" essentially. Document root/application files will live in their home directory along with ruby version(s) and gemsets managed with RVM. A user will have one or more web apps it needs to run. The virtual hosts for this user's site will point to the document root in the users home dir and webserver will also effectively run as this user:group
.
Example layout:
/home/theuser
/.rvm
/applications
/railsapp1
/public
[ other rails dirs ]
/somephpapp (symfony, zf, etc.)
/public
[ other framework dirs ]
/www
/railsapp1.com (ln -s ../applications/railsapp1/public)
/somestaticsite.com
/somephpapp.com (ln -s ../applications/somephpapp/public)
So...
Question 1: I this even possible? I know passenger supports ruby versions and passenger users (i assume the passenger user equiv to specifying the user:group for fcgi, php-fpm, SuExec) at the virtual host level but all the intstuctions im finding seem to install the apache module from a specific RVM user, that seems odd. Or is it just a matter of creating a generic user to install the module from and then doing everything else on a per account basis?
Question 2: Even if this is possible is the correct way to set things up? Whats the best practice here given that:
- The webserver/application MUST run as a given account's user:group
- MUST have the ability to run different version of ruby on per application basis
- Each user MUST be able to run multiple applications
- Each application MUST be contained under a specific user's home dir
- The user MUST be sandboxed to his/her homedir (not a sodoer)
(Note: I myself am not a ruby dev/user aside from the odd shell script here or there or using compass/zurb-foundation so Im open to options other than Passenger. Also this server is not intended as a production environment.)