Passenger on 64-bit Mac OS X

Manfred Stienstra

After some searching we found out that Passenger doesn’t run on Mac OS X because it segfaults on 64-bit BSD systems. All Core 2 Duo and Xeon systems are 64-bit, so that includes newer Mac Mini, Macbook, Macbook Pro, Macbook Air and Mac Pro.

A workaround for now is running Apache in 32-bit. Because Apache is compiled as a Universal binary, that is really easy to do.

The quick but short term solution is to start httpd by hand:

$ sudo arch -i386 /usr/sbin/httpd

The lasting solution is to change the Apache plist:

First we create a backup of the current plist.

$ sudo cp /System/Library/LaunchDaemons/org.apache.httpd.plist \
/System/Library/LaunchDaemons/org.apache.httpd.plist.bak

After that we open the plist in our favorite text editor.

$ mate /System/Library/LaunchDaemons/org.apache.httpd.plist

And change:

<key>ProgramArguments</key>
<array>
	<string>/usr/sbin/httpd</string>
	<string>-D</string>
	<string>FOREGROUND</string>
</array>

Into:

<key>ProgramArguments</key>
<array>
	<string>arch</string>
	<string>-i386</string>
	<string>/usr/sbin/httpd</string>
	<string>-D</string>
	<string>FOREGROUND</string>
</array>

And restart Apache:

$ sudo launchctl stop org.apache.httpd

Launchd will automatically start Apache for you after the stop command. Now Apache is running in 32-bit and should run Passenger just fine.

Update: Fixed in 1.0.2. Please update your gem and passenger-install-apache2-module if you’re having this problem.