Changes

Umlaut Deployment

2,666 bytes added, 23:31, 24 November 2008
no edit summary
Turns out there are several possible deploy environments for a Rails application. There is not necessarily one standard or best one at the moment, different people use different ones in different circumstances.
Jonathan Rochkind at Hopkins uses mongrel, mongrel_cluster and Apache mod_proxy and mod_proxy_balancer on a unix system for his deploy environment. He went down this road because it was what was recommended by the [http://www.pragprog.com/titles/rails2 Rails Agile Development book]. Georgia Tech is currently using a different We may explore other deploy environment for itenviroments (such as 's Umlaut version 1, but mongrel_cluster/apache is the only currently demonstrated way to deploy passenger') in the current Umlaut versionfuture. We would definitely not be optimistic about running Umlaut on Windows.
Since jrochkind is writing this documentation, he can only tell you how to do it how he did. You do need to have a verison of Apache that includes mod_proxy_balancer (> apache 2.2? ), but if you do, jrochkind is fairly happy with the solution.
These two pages from the mongrel website on [http://mongrel.rubyforge.org/wiki/Apache Apache Best Practice Deployment] and [http://mongrel.rubyforge.org/docs/mongrel_cluster.html Using Mongrel Cluster] are pretty good how-tos for mongrel. But we will also take you through it here, with specific directions and Umlaut recommendations and pit-falls we ran into.
== Quick start 'wizard' == New! A Rails generator to set up config files for you, and make deployment with mongrel cluster and apache much easier.  === Prerequisites === * Instead 'mongrel' and 'mongrel_cluster' gems. * Apache needs mod_proxy and mod_proxy_balancer (which means it needs to be apache >2.2 I think, and have those modules turned on). * You need to have access to an apache conf file to add some statements to hook your mongrel cluster up to the web.  === To run === You can simply run ./script/generate mongrel_deploy_files to generate config files for an Umlaut mongrel cluster deployment. This makes some assumptions, detailed below--to change all of these options, run ./script/generate mongrel_deploy_files --help to see command line arguments, if you aren't happy with these defaults.  You can run this command at any time. It will interactively prompt you if you want to overwrite your existing files, and give you a diff. (Or you can say --force to force overwriting of existing files). You can also run ./script/destroy mongrel_deploy_files to remove anything created by the generator.  This process will add two files in umlaut_config/deploy, and one file in $UMLAUT/script/local/. Next, you need to hook up apache, and start your mongrels.   === default assumptions === Several mongrel processes are being configured. By default, this is four mongrel processes on internal ports beginning at port 4001. Both of these things can be changed.  By default these mongrel processes will be run as unix user 'umlaut', group 'umlaut'. So either create such a user or group, or add arguments to choose other user/group.  By default the generator assumes that you are going to be deploying at 'document root' (/) in a particular apache (virtual) host. If you'd like to instead install at a sub-path, use the --prefix argument.  === Hook up apache ===  A file was created for you in umlaut_config/deploy/umlaut_http.conf. You need to edit your apache conf file to "Include" this umlaut_http.conf in the virtual host of your choice (or main host). You need to set up the virtual host yourself, if you want one. Then simply "Include /path/to/umlaut/config/umlaut_config/deploy/umlaut_http.conf".  === Start mongrels === Apache is now pointing to a balanced cluster of mongrels on the ports specified by the generator, from the path specified by the generator. But those mongrels aren't running yet. You need to start them. You can do this by running: <pre>sudo mongrel_rails cluster::start -C /path/to/umlaut/config/umlaut_config/deploy/mongrel_cluster.yml</pre> Or, for convenience, the generator installed a little bash script to do this all for you: <pre>$UMLAUT/script/local/my_mongrel_ctl (start|stop|restart|status)</pre>   == The details: Umlaut Deployment with Mongrel and Apache ==
There are basically two parts to getting Umlaut (or any Rails app) deployed in this setup. First is getting your Rails app running, and second is configuring Apache to connect to it properly.
Anonymous user