Summarymrnginx stands for mongrel_cluster rails nginx. It's a helper script which makes configuring multiple Rails sites with mongrel_cluster and nginx ridiculously easy.
Currently, this script is configured for Ubuntu Server, however with a little tweaking it should work on other distros.
... [More]
Here's what it does:
creates mongrel_cluster YAML configuration file symlinks this file to /etc/mongrel_cluster creates nginx vhost file overwrites (and backs up) nginx configuration file (/etc/nginx/nginx.conf) restarts mongrel_cluster restarts nginx Before it does anything, it will list what it is about to do and await your confirmation.
Prerequisitesrubygems (to install the following gems) apt-get rubygems (on Ubuntu) mongrel gem install mongrel mongrel_cluster gem install mongrel_cluster nginx apt-get nginx Example usagecd /var/www/apps/myrailsapp
mrnginx -s myrailsapp.com,myrailsapp.netThat's it! (Except DNS configuration of course).
Note: you'll probably need to run it as root (or sudo mrnginx).
mrnginx -h will display this:
Usage: mrnginx [options]
Specific options:
-e, --environment ENV Rails environment to run as
[default development]
-p, --port PORT Starting port to bind as
[default next unused port after 8000 + 10]
-a, --address ADDR Address to bind to
[default 127.0.0.1]
-c, --chdir PATH Change to dir before starting (will be expanded)
[default current working directory]
-s DOMAIN1,DOMAIN2 Domain(s) for virtual host
--server-names [default localhost]
-N, --num-servers INT Number of Mongrel servers
[default 3]
--user User to run as.
[default www-data]
--group Group to run as.
[default www-data]
Common options:
-h, --help Show this message
-v, --version Show versionAuthorZubin Henner [Less]