Changes

Jump to: navigation, search

Umlaut Deployment

920 bytes added, 16:19, 19 June 2012
no edit summary
=WARNING: This is Outdated Documentation!!!!=
 
'''THIS IS OUTDATED DOCUMENTATION''' See new Umlaut documentation at http://github.com/team-umlaut/umlaut/wiki
---------
 
[[Category:Umlaut]]
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]. We may explore other deploy enviroments (such as 'passenger') in the future. We would definitely not be optimistic about running Umlaut on Windows.*Lately mod_rails/Passenger is clearly the preferred Rails deployment in general, and jrochkind wants to find time to set it up and test it, but hasn't yet.*
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.
 
Alternatively, based on Ross Singer's recommendation, scotdalton is using [http://code.macournoyer.com/thin/ thin] and Apache at NYU. The setup is almost identical to mongrel and is detailed at [[Umlaut Deployment with Thin and Apache]]
== Quick start 'wizard' ==
=== Prerequisites ===
* Instead Install '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 ===
The point of mongrel_cluster is to save configuration information for multiple mongrel instances in one configuration file, and then you can start, stop, or restart them all with one command, and without having to remember that config information each time (and possibly get it wrong or typod).
By default, mongrel_cluster keeps that configuration file in a Rails app's config/mongrel_cluster.yml. You could do that with Umlaut, but we like to keep your local config files in $Umlaut/config/umlaut_config instead (see [[Umlaut Local Configuration Architecture]]), so we recommend putting it in $Umlaut/config/umlaut_config. You can use the mongrel_rails command to write this config for you (see [http://mongrel.rubyforge.org/docswiki/mongrel_cluster.html MongrelCluster Using Mongrel Cluster]; make sure to use the -C argument to put the config file in umlaut_config, if that's what you want), but here we'll just give you our actual mongrel_cluster.yml config, annotated. (You are certainly allowed to write it by hand).
<pre>
# Set up ProxyPass directive to reverse proxy to SFX for handling SFX journal subscription cgi posts
# This should come before the cluster ProxyPass directive.
ProxyPass /resolve/cgi/core/journal_subscription.cgi http://sfxyour.librarysfx.nyuhost.edu:8888port/sfx_testyour_instance/cgi/core/journal_subscription.cgiProxyPassReverse /resolve/cgi/core/journal_subscription.cgi http://your.sfx.library.nyuhost.edu:8888port/sfx_testyour_instance/cgi/core/journal_subscription.cgi 
# Now set up the ProxyPass directives to reverse proxy to that cluster
# ProxyPassReverse /findit balancer://umlaut_cluster/findit/
</pre>
 
====SSL/https====
 
If you are setting up apache to allow https requests, it should still proxy to an http mongrel as above, because mongrel doesn't speak http. However, you should include this line in the relevant SSL virtual host, to set the request header to let the Rails app know it's fronted by ssl:
 
RequestHeader set X_FORWARDED_PROTO 'https'
=== Dealing with bad query strings: More Apache Setup ===

Navigation menu