Putting the pane back into deployment
We blogged how using Passenger made development easier, but being the Mac User Interface Junkies we are, we’d like to take it one step further.
This was a great opportunity to play with preference panes in RubyCocoa. Thanks to Jason Foreman, and his repository of templates, I didn’t have to spend a lot of time finding out how to initialize a prefPane bundle.
It turns out that creating basic features with a mediocre interface (the default stuff you get from Interface Builder) can be done fairly quickly. However, making it look and feel like a preference pane from the “OEM fruit company” is a different story. Who would have thought?! ;)

Thijs doing interface design with the latest available technologies. Can you spot the advanced z-index technique he used? Hint: Starts with a P.
Anyways, back to the introduction; after roughly 2 weeks we give you an OS X System Preferences pane that will configure Apache and set up a local hostname for running any Rails application using Phusion Passenger. Getting your Rails app up and running is now a matter of seconds.
Most users probably want to download the “stable” 1.0 release.
If you understand why stable has been quoted, you can track development and contribute on: github.com/alloy/passengerpane
Please report any bugs you may find at: fingertips.lighthouseapp.com/projects/13022
Note that Passenger preference pane requires OS X 10.5.2 (or at least 10.5.0 and install RubyCocoa 0.13.2 yourself) and Passenger 2.0.1.
Comments
Add your comment
In order to fight spam on this blog, posting comments from a browser without javascript is currently not supported.
Subscribe
Jordan Arentsen about 9 hours later: (delete | show email)
Very nice, I definitely plan on using this when I move to Leopard. ¶
Erik about 10 hours later: (delete | show email)
Fantastic. Does exactly what I've been manually doing.
It'd be nice if it warned you when you have "Web sharing" turned off. ¶
gaur about 10 hours later: (delete)
Is the hours project available ? ¶
Thijs van der Vossen about 19 hours later: (delete)
The hours project is internal for now. ¶
Tom about 20 hours later: (delete)
That is very handy and we'll be using it on our showcase laptops, however for me it's no good for development because I can't jump into a debugger irb console like you can with script/server. ¶
Eloy Duran about 20 hours later: (delete)
@Tom: Technically ruby-debug does support remote debugging, so it should be possible. I haven't tried it yet though... ¶
topfunky 1 day later: (delete | show email)
Impressive! I keep my Passenger config in source control so I can use it between machines, but this is such a nice interface that it makes me want to use it anyway! ¶
Thijs van der Vossen 1 day later: (delete)
@topfunky: The Passenger preference pane stores the Apache configuration in /etc/apache2/passenger_pane_vhosts/ so you should be able to version that.
Also, if you don't need to customize the Apache configuration you can configure all the Rails applications you're working on at once by dragging multiple folders into the source list. ¶
Sander Heilbron 2 days later: (delete | show email)
Very nice, thanks guys! ¶
Marcus 3 days later: (delete)
This is awesome. Thanks. ¶
Jason Foreman 3 days later: (delete | show email)
Looks great Eloy! Glad you found my template to be of some use. ¶
Jonno 3 days later: (delete)
Does it support rack apps? ¶
Manfred Stienstra 5 days later: (delete)
Jonno, I don't think it needs to explicitly support Rack apps because you basically just point Passenger to a directory and it automatically looks to either Rails environment files, Rack config.ru or WSGI python stuff.
So in short; it should work. ¶
Cesidio 5 days later: (delete)
Thanks for this great product.
what about adding options for setting:
ErrorLog (defaults to log/error.log in your app would be very nice)
RailsBaseURI (which is also very common) ¶
Manfred Stienstra 6 days later: (delete)
Cesidio, we're not going to support any more configuration options. The idea is to only support quick and fast configuration from the user interface.
You can drag the domain name from the source list into your favorite editor to quickly open the vhost file. That way you can do advanced configuration. ¶
Alistair Holt 6 days later: (delete | show email)
Excellent guys. You beat me to it!
One question - This still requires manual additions to /etc/hosts to get the *.local addresses doesn't it? ¶
Alistair Holt 6 days later: (delete | show email)
Answered my own question about /etc/hosts heh. Cheers! ¶
Manfred Stienstra 6 days later: (delete)
No, the pane adds the local hostnames to the Directory Services. You can look at the entries with:
$ dscl localhost -list /Local/Default/Hosts ¶
Michael Erb 6 days later: (delete)
Exactly the way it should work. Brilliant guys, really, well done! ¶
gerry leo nugroho 6 days later: (delete | show email)
Hi,
I'm on Mac OS X (10.4.11), I've upgraded my RubyCocoa and Passenger as instructed. But, I couldn't get it to work as intended? Any ideas why? Here's a <a href="Installing PassangerPane on Mac OS X (10.4.11)" title="Installing PassangerPane on Mac OS X (10.4.11)">screenshoot</a> of what I got so far. Hope you could help me, Cheers. ¶
gerry leo nugroho 6 days later: (delete | show email)
Ouch... mind my previous posting... the screenshoot is <a href="http://www.flickr.com/photos/leonism/2626216383/" />here</a>.
Forgot to put the URL. ¶
Eloy Duran 6 days later: (delete)
Sorry, atm the pane only works on Leopard. I have updated the requirements to be more specific about this.
The problem in the interface with the +/- buttons is because the NSImage template support was added in Leopard. The Warning s still shown because we assume the Apple supplied Apache 2 in Leopard.
There are no plans to update this, but feel free to hack on it :) ¶
Michael Boutros 7 days later: (delete | show email)
For this to work on my MacBook, I have to go into the Preference Pane-generated .conf file and change <VirtualHost *:80> to <VirtualHost name.local:80>. Does anyone know why this may be?
Thanks! ¶
Tim 8 days later: (delete)
I'm running Leopard and originally installed Apache2 from source as the link from Passenger's site had shown... I have everything working great normally/manually. But the PrefPane doesn't do a thing for me. Says the extension isn't there... but in fact it is. Am I missing something obvious? ¶
Manfred Stienstra 8 days later: (delete)
Michael, are you sure that what was made it work and not an Apache restart or something?
Tim, the pane only works with default Leopard installation paths right now.
If you think this is a bug, please create a ticket here: http://fingertips.lighthouseapp.com/projects/13022 ¶
Tim 9 days later: (delete)
Manfred, ah no worries mate... I killed the added item in the path for the custom Apache2 install and reinstall the passanger module for the Leopard default install and everything is working great. Seriously... awesome work! ¶
Manfred Stienstra 9 days later: (delete)
Tim, good to hear it worked out for you. ¶
Chuck Bergeron 15 days later: (delete | show email)
Hey guys, great work! This is super handy. I'm having a small issue with my typical DocumentRoot conflicting with the VirtualHost entries setup in /etc/apache2/passenger_pane_vhosts - Currently, when I leave the ServerName as *:80, the Rails apps work great but the typical http://localhost/ loads the first VHost entry, and http://localhost/myadmin/ redirects to http://localhost:3000
Any ideas? I assume this is just my lack of understanding ye olde httpd.conf and those vhost entries.
Thanks!
` Chuck ¶
Manfred Stienstra 15 days later: (delete)
Chuck, I'm afraid you're going to have to debug those problems yourself. One tip though; if one of the VirtualHosts conflicts with your default DocumentRoot, you might want to move that to a VirtualHost too.
People on one of the Apache mailing lists (http://httpd.apache.org/lists.html) might be able to help you out with with any more questions you might have. ¶
Chuck+Bergeron 16 days later: (delete | show email)
Great, thanks Manfred! I'll give that a try. ¶
Chuck+Bergeron 16 days later: (delete | show email)
Yup! Setting up localhost as a vhost worked like a charm! Thanks again, Manfred. ¶
Jamie 21 days later: (delete)
This is fantastic! My only gripe is that it is Rails centric, and I had to manually edit the generated files to work with my Merb apps. How about a toggle between Rails and Rack apps, or at least a textbox in the pane that let's us customize the apache include files? ¶
Thijs van der Vossen 21 days later: (delete)
Jamie, you can drag an item from the source list onto your favourite editor if you need to customize the configuration files. IMHO that's a much nicer interface for advanced users. ¶
riki 47 days later: (delete | show email)
I'm getting the following error.
Can’t find the Phusion Passenger Apache module. Visit http://www.modrails.com for installation instructions. ¶
riki 47 days later: (delete | show email)
Never mind, still mistake on my part, it's working now. ¶
Lucas Efe 48 days later: (delete | show email)
Mmm, I am having some issues here.
I add the rails folder into de PrefPane, apply and quit. But when I return to the PrefPane I get an empty window. The configuration is missing. Also, no file is created in the apache folder.
Any idea?
PS: I have ruby built from source, in a custom location, but included in the PATH. ¶
Lucas Efe 48 days later: (delete | show email)
Forget about this. I am creating a ticket ath the lighthouse.
:) ¶
Douglas F Shearer 49 days later: (delete | show email)
Slightly OT, but what's the keyboard in the pic? Looks like a Happy Hacker Mac edition, something I've been trying to get hold of for a long time.
Awesome pref pane btw, makes life so much easier. ¶
Manfred Stienstra 49 days later: (delete)
Douglas, it's a normal grey Happy Hacking Keyboard Lite 2: http://pfuca-store.stores.yahoo.net/haphackeylit1.html ¶
salomoko 51 days later: (delete)
SO freakin sweet dude!
thanks much, however, one question; Where does the pref pane store the vhosts directives file? I have plenty of existing apps running under passenger already and I put my directives in /etc/apache2/extra/httpd-vhosts. I'd like to consolidate my directives.
any thoughts? ¶
Manfred Stienstra 51 days later: (delete)
The virtual host configuration is written to /etc/apache2/passenger_pane_vhosts. ¶
salomoko 52 days later: (delete)
thanks lots! ¶
Bryce 59 days later: (delete | show email)
Really great PrefPane. I use Apache VirtualHosts extensively with non-Rails projects, and I hate having to add the config files and edit /etc/hosts for each one, it would be great if you could make a general Apache Virtual Host Preference Pane for those who don't use Rails. ¶
Douglas 62 days later: (delete | show email)
I really appreciate you putting this out there. Now I get pretty URL's in development too. ¶
Daniel 73 days later: (delete)
Glorious. Thanks! ¶