I'm looking to group together the information on the current best practices for deploying a Rails application on a server I run (rather than, say, Heroku). The application is developed by multiple people, and they all have permission to deploy it. The application will run on a server that may have more than one application.
- Use Apache or Nginx with Passenger
- I use Ubuntu, but that shouldn't make too much difference.
- Capistrano seems to be the best way to go to push to the server.
Now, some doubts I have:
- Use RVM or not? Passenger can only use one version of Ruby, so it's sort of useless, no?
- How would you structure user permissions and ssh keys? My thinking is that you definitely don't want to have the user be 'yourself' (dnw, say, on the server), but a role account. Is Ubuntu's www-data sensible for this, or would it be better to create a different user? One for each application? What sort of configuration (shell in /etc/passwd, for instance, groups, etc...) should these users have to make the system as safe as possible if someone finds a vulnerability in the web application? What sort of capistrano recipes would you utilize to achieve this?
- Now, we add git into the mix: git needs to be able to pull without a password from the git server, so there's going to be some key exchange going on. How should the remote git setup look like in order to make things nice and safe?
- Anything else that I'm not covering?