S.E.A.N.I.C.U.S.

Monday, April 10, 2006

The long road to deployment

You know, I posted a lot of stuff before about deploying Rails apps, and I'd like to recap and revise those comments.
  • If you need to deploy applications quickly and have no prior bias toward servers, use lighttpd. I found it very easy to get my Rails apps running. However, I got discouraged when I had too much difficulty hosting more than one app on a single domain/vhost.

  • Don't rule out Apache + FCGI. If you're running Apache 1.3.x, mod_fastcgi works spectacularly. I discovered this because it's the default configuration for Capistrano; I figured it couldn't be THAT hard if someone else could make it work. Whereas lighttpd has weaknesses in running multiple apps, Apache shines via its extremely flexible mod_rewrite functionality. Make sure your version builds it in, or rebuild the mod using apxs and install it. With minor tweaks to the .htaccess, your app should be very happy.

  • If you're running Apache 2.x, all is not lost. You can use mod_fcgid (or mod_proxy_fcgi for 2.2), which is pretty easy to build/install. The configuration directives are WILDLY different from mod_fastcgi, so be sure to check out the Rails wiki for clues on what to use.


I have apps running in all three of these configurations, just to see if I could do it. Now if there emerges a rock-solid way to host multiple Rails apps on a single domain within lighttpd, I'll whole-heartedly support that. Lighty is just so much less of a beast than Apache. In the meantime, 1.3 or 2.0 with the appropriate module will work just fine for me.