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?


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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