Adam Perfect

General

Installing Phusion Passenger on a cPanel server

A while back, Phusion released a product called Passenger, effectively mod_rails for Apache. The idea is that rather than having to do a lot of the usual manual setup work when running a Rails app (using mod_proxy to point at mongrel_clusters, etc.), you can just have them run automatically via Apache, the same way PHP apps will. Today I finally managed to get it running and while the solution was simple, it's hard to find. My problem was that I have WebHostManager/cPanel running on my server, which installs Apache for you. This has the common trade-off of being very convenient, but reducing your options for true customization. So when you run:

passenger-install-apache2-module

the installer will tell you to install the httpd-devel library via 'yum install httpd-devel'. Trying that just had yum return a 'nothing to do' response because it had decided there wasn't an httpd-devel package to be found. I've had a couple of half-hearted attempts in the past few months trying to find an rpm for httpd-devel to match the version of Apache cPanel currently installs (2.2.9) to no avail for my CentOS box. Today I tried a bit harder while setting up a new server and found the solution! It turns out (thanks to this thread on the cPanel forums) that cPanel excludes all yum packages for httpd to avoid conflicts, although the tools are actually installed when cPanel installs Apache. So they're there, Passenger just doesn't know that. The cPanel thread provided the solution to this problem by basically pointing the Passenger installer at apxs:

APXS2=/usr/local/apache/bin/apxs passenger-install-apache2-module

Now the required dependencies checks should pass and hopefully all will be fine. I did however hit one more problem, with a complaint along the lines of

Written by Adam on

Adam is a Director of User Experience by day and photographer as time allows.

You may also like…