Magicmonkey

Magicmonkey is a useful script that can manage your Ruby on Rails applications. Magicmonkey allows you to build in easy way the follow web server architecture:

+---------------------------------------------------------------------------------------------------+
| Apache web server                                                                                 |
| +----------------------+      +----------------------+               +----------------------+     |
| |Proxy A (virtual host)|      |Proxy B (virtual host)|               |Proxy C (virtual host)|     |
| +---------^------------+      +---------^------------+               +---------^------------+     |
|           |                             |                                      |                  |
+-----------|-----------------------------|--------------------------------------|------------------+
            |                             |                                      |
+-----------v-------------------+ +-------v-----------------------+ +------------v------------------+
| Application server standalone | | Application server standalone | | Application server standalone |
| Phusion passenger             | | Phusion passenger             | | Thin                          |
| Ruby 1.9.2                    | | Ree 1.8.7                     | | Ruby 1.9.2                    |
| Listen on port 3000           | | Listen on port 3001           | | Listen on port 3002           |
| Site foo.com                  | | Site bar.com                  | | Site wella.com                |
+-------------------------------+ +-------------------------------+ +-------------------------------+

Every your web applications have a virtual host like this:

<VirtualHost *:80>
  ServerName foo.com
  PassengerEnabled off
  ProxyPass / http://127.0.0.1:3000/
  ProxyPassReverse / http://127.0.0.1:3000/
</VirtualHost>

A proxy that speak with an application server standalone mode (like Phusion Passenger v3) that run with a specific Ruby version. To do this you need to have install RVM to manage multiply Ruby versions.

Install

gem install magicmonkey

Usage

First of all you need to say to Magicmonkey that you want manage an application in this way. To to this use the magicmonkey command ‘ADD’:

magicmonkey add APP_NAME [options]

When added, you can start, stop, restart the application

magicmonkey {start|stop|restart} APP_NAME1, APP_NAME2, ...

If no application is given start, stop, restart all application.

You can show the configuration of all your applications with

magicmonkey show

Magicmonkey save the configuration in ~/.magicmonkey.yml

Support

You can use this email address for any questions or help: [email protected].

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Copyright © 2010 Enrico Pilotto. See LICENSE for details.