4.2. Common Configurations
Now that you can see how easily Mongrel can be configured, let's see what people are doing with it. Most of the configuration options will change from defaults because you want to run Mongrel in a cluster or in a production environment where you want to sit it behind a static HTTP server like Apache.
4.2.1. Mongrel Standalone
As a real HTTP server, Mongrel will work just fine as a front-facing Web server. After all, this is how it works in your development environment. Typically small Web sites will run just fine with a single Mongrel process. If you need SSL, you can run Mongrel behind a reverse-proxy like Pen. If you have request hogs like file uploads, you'll probably want to run more than one Mongrel, which means you'll need Mongrel Cluster and a reverse-proxy server.
4.2.2. A Pack of Mongrels (mongrel_cluster)
Depending on what kind of Web application you're running and how much traffic you expect, you might want to have multiple Mongrel processes running in a cluster. If you are accustomed to running multiple FCGI processes, then you will want to run a cluster of Mongrel processes (a "cluster" in this case does not mean you need separate machines, just separate processes running on a single machine). To help figure out how many Mongrels you'll need, you should read "How Many Mongrels" (http://rubyforge.org/pipermail/mongrel-users/2006-May/000200.html). If you need at least two, then you'll want to run a cluster. You do this with the mongrel_cluster gem, written by Bradley Taylor from RailsMachine. Detailed instructions for setup and use are available on the Mongrel Web site (http://mongrel.rubyforge.org).
4.2.3. Mongrel Behind a "Static" Web Server
188.8.131.52. Static Server Options
Apache has been frowned upon by many Rails developers because of its flaky support for FastCGI, which was previously the least-horrible way to run a Rails application. FastCGI was pretty buggy, requiring scripts like script/spawner and script/reaper to kill and start FastCGI processes on the fly. Since Mongrel eliminates this problem, Apache has become a preferred option among those running Rails sites. We provide an example configuration with Apache in Section 5.
184.108.40.206. What about LightTPD?
When FastCGI was the best option out there, LightTPD (aka Lighty) was considered a top choice for a static server, sometimes preferred over Apache. At the moment Lighty's mod_proxy module has a bug that will not properly connect to Mongrel processes if they go down and come back. This problem will be fixed in Lighty 1.5.0 with the mod_proxy_core module. Keep an eye out for Lighty announcements. Once this issue is resolved, Lighty will likely return to the shortlist.