techno
xckd rules.
(And I like techno.)
I installed Phusion Passenger aka mod_rails this evening on my Leopard installation. It didn’t go quite as smoothly as I’d expected, although it did ultimately work. If you’re having some issues getting it running, this may help.
The first thing that went “awry” was the fact I was using Mac OS X at all. There is something wrong/non-standard with the apache2 installation included with Leopard, and Passenger doesn’t work with it. When I ran the passenger-install-apache2-module utility I was notified of this, and the tool suggested installing a new copy of apache2. Rather than compile it manually, I opted to go the MacPorts route.
Unfortunately, that too had a problem: it wouldn’t compile. A quick perusal of the configure script log indicated that a suitable version of awk wasn’t installed, and the portfile didn’t know enough to install a proper version as a prerequisite. A quick sudo port install gawk took care of that.
I then reran the passenger-install-apache2-module, which didn’t automatically locate the new apache installation. I followed the instructions to set the APXS2 environment variable, but it didn’t take. Ultimately the problem ended up being that the new apxs wasn’t on my path. I updated it in my .profile to include /opt/local/apache2/bin, which fixed that issue.
In order to ensure no additional conflicts, I deactivated web sharing in OS X. This disables the built-in apache installation. I then copied the sample apache configuration file in the /opt/local/apache2/conf/ directory to httpd.conf, and added the lines requested by the tool. Next I configured apache’s virtual host file to point to a new hosts.conf I created in the same directory. From there I added a virtual host as instructed to point to my Rails app.
Upon visiting localhost in a web browser my app fired right up, but none of my styles or javascripts loaded. It turns out I had to add a <Directory> directive in the vhost with the contents allow from all. That fixed the last issue. Note that by default Passenger runs your app in production mode. The documentation states to change this in your config/environment.rb file, but when I tried it this didn’t work. You can add a RailsEnv development to your httpd.conf, but this is a global setting. I’ve logged this bug in the tracker.
Despite these glitches, I’m really excited about Passenger. I went through the installation process at work earlier today on a CentOS installation, and it went seamlessly. Most of us aren’t deploying to Mac OS X, so I’m willing to overlook the minor shortcomings on OS X because the Linux deployment went so well. In either case, it’s free, and it’s only going to get better from here.
Passenger has the power to do wonderful things for the Rails community. It will be very interesting to see this start to roll out at shared web hosts around the globe. The widespread availability of cheap, easy Rails hosting could be a game-changer. I look forward to meeting the fine fellows at Phusion at RailsConf this year.
If you find Passenger useful, please consider donating to the Phusion guys. They’ve sweat a lot of time into this code, and as far as 1.0 releases go you couldn’t ask for much more.
The Guy posted this article on April 12th, 2008.
Courtesy of digg.
This is my blog. Who am I? That's a swell question.
2fkd is proudly powered by
WordPress
Entries (RSS)
and Comments (RSS).