Passenger Brings Rails Apps to Apache

by Ostatic Staff - Aug. 18, 2008

For many years, Apache has been the de facto standard for Web site and application deployment. The open-source Web server, which was originally created as "a patchy" version of the original NCSA HTTP server, has become a highly modular, and customizable, piece of software that can handle nearly anything that an Web site might require. Nearly every open-source Web developer used Apache -- except for programmers using the Ruby on Rails framework, for whom Apache was a poor fit. Instead, Rails developers typically deployed with lighttpd or Mongrel, using Apache or nginx for the site's static components.

Apache fans in the Ruby community were thus delighted several months ago, when Phusion released Passenger, an Apache module for deploying Rails applications. I have been working with Passenger over the last few weeks, and am pleased to report that the module is extremely easy to install, use, and configure. Passenger has succeeded in bringing me back into the world of Apache after several years of wandering in the HTTP server desert.

Passenger wouldn't succeed if it were difficult to install. And it is hard to imagine an easier installation process: You download the Ruby "gem" package, an act which Ruby developers do on a very regular basis. You check that Apache is installed on your system. You then issue a simple command ("passenger-install-apache2-module"), which first checks that the prerequisite programs and libraries are installed, and then compiles and installs the module for you. Modify your Apache configuration using the boilerplate code that Passenger provides, and you are up and running. I believe that the entire process, including downloads and compilation, took less than 15 minutes on my first try.

Once Passenger is installed, you start and stop your Rails application using the standard Apache tools. You can optionally take advantage of some tricks, such as restarting the Rails application by creating a specially named text file. But for the most part, Passenger means that anyone familiar with Apache can deploy a Rails application without much difficulty. Passenger also makes it easy to monitor the memory usage of each Apache process with its included "passenger-memory-stats" program. This makes it possible to check that Rails applications are not consuming too much memory, a common concern in the Rails world.

Rails is often accused of going its on way, using specialized tools that don't work well with the rest of the world. One example is "rake," the Make-like utility that is an essential part of every Rails developer's toolbox. Rake enthusiasts point to the endless complaints that developers have had about Make for years, and how many problems it has caused. Rake detractors see it has a needless duplication of code, comparable in some ways to Ant, which introduces a new syntax -- and thus hurdle -- that makes it harder for newcomers to join the Rails community.