Installing Phusion Passenger on Mac OSX

Installing Phusion Passenger on Mac OSX

April 9, 2010   ·   By Sheldon Conaty

Actually this is incredibly easy, assuming you have the gem manager installed (see here if you want instructions).

The phusion installer is excellent. All you need do is open a terminal and enter...

sudo gem install passenger
sudo passenger-install-apache2-module

Then just follow the on-screen instructions with the following caveats...

Caveat 1: Adding Phusion to Apache

The install suggests you add the following lines to you apache config (which can be found in /etc/apache2/httpd.conf )

LoadModule passenger_module /opt/local/lib/ruby/gems/1.8/gems/passenger-2.1.3/ext/apache2/mod_passenger.so
PassengerRoot /opt/local/lib/ruby/gems/1.8/gems/passenger-2.1.3
PassengerRuby /opt/local/bin/ruby

However, I suggest you add these to a new file in a separate conf file. Create a file with the following name and apache will load it automatically on startup.

/private/etc/apache2/other/phusion.conf

Tip: Restarting Apache

The phusion install asks that you restart Apache. This can be done using:

sudo apachectl -k restart

Caveat 2: Deploying your Application

Again the install program is very clear. It says you should add the following to your Apache config

<VirtualHost *:80>
  ServerName www.yourhost.com
  DocumentRoot /somewhere/public    # Be sure to point to 'public'!
</VirtualHost>

But remember to remove the comment "# Be sure to point to 'public'!" or Apache will display the following error on restarted:

DocumentRoot takes one argument, Root directory of the document tree

Also, you should add the following after the virtualhost definition.

<Directory "/somewhere/public">
  Options ExecCGI FollowSymLinks
  AllowOverride all
  Allow from all
</Directory>

This gives Apache access to your Rail app’s directory, getting rid of any annoying 403 ‘access denied’ errors.

That’s pretty much it. Remember, by default phusion will run your application in production mode. So ensure your database.yml file has a production database configured.

 

Post Comments

blog comments powered by Disqus

© Copyright 2009-2012 Peer Assembly | All Rights Reserved.