Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have several rails applications on my server. Each application uses its own rvm gemset. I'm using Thin as web server for each application, this servers installs as a gem separately for each application. Each server runs on different port. Main server nginx acts as a proxy server.

I need the following functional to be available through some scripts:

  • Run all thin servers.
  • Start, stop or restart any server.
  • Check every minute (by cron) if application is running correctly (HTTP status 200). Auto restart application if check is failed.
  • Each application must not be able to access data of another application. They should be launched in chroot or by different users.
  • Auto generate nginx configuration.

Adding new application to the system should be easy.

What can you suggest to achieve this?

Thin can be replaced with any other server if necessary. Main nginx server is also using for running several PHP sites, so I don't want to replace it.

I was thinking about recompiling nginx with passenger module and installing it as main server. If I do this, will it be possible to run each application using its own ruby installation and gemset?

share|improve this question

To monitor and autorestart or do other autoreaction methods I would use nagios or icinga. Probably you need to implement different checks and autoreaction methods yourself, but this framework is very flexible and can grow with your installations. Or/And Puppet for configuration and installation duties.

To separate the installations different users should be ok in most cases, I think it depends on your security constraints.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.