MAMP, Headdress and Quicksilver

MAMP and Headdress are the perfect combo for local development on OS X. The only difficulty I’ve encountered using these two programs is remembering the different port numbers for my local sites. To solve that problem I cooked up a simple PHP script that parses the Headdress-commented MAMP httpd.conf and generates an HTML fragment document that can be indexed by Quicksilver. Now when I want to launch a local site I just hit control+space and start typing the name I’ve given it in Headdress.

The instructions that follow assume that you have already configured MAMP to host multiple local sites with Headdress.

  1. Unzip headdressed.zip and move the headdressed folder to /Applications/MAMP/htdocs
  2. Open http://localhost:8888/headdressed/ in a browser. This will generate headdressed.html and display its contents. (Repeat this step any time you add new sites or see step 4.)
  3. Open Quicksilver’s Preferences and click on “Catalog.” Choose “Custom” from the bottom of the source list and add a new “File & Folder Scanner”. Browse and select /Applications/MAMP/htdocs/headdressed/headdressed.html. In the drawer that appears, select “HTML Links” from the “Include Contents:” drop-down and check “Ignore source item.” Refresh your catalog.
  4. (Optional) Open MAMP’s Preferences and under the “Start/Stop” tab check “Open start page at startup”. Change the start page url to /headdressed/. Now when you launch MAMP after adding a new site with Headdress you’ll be greeted with a list of links to all local sites and generate an updated headdress.html to be indexed by Quicksilver.

This may seem like a rather circuitous solution but until there’s a native integrated solution (any readers know how to write a Quicksilver plugin?) it gets the job done without having to manually maintain a list of bookmarks.

Headdressed has been downloaded 666 times.

Previous
Three Quarter Creep
Next
SimpleBits
Author
Shaun Inman
Posted
December 4th, 2006 at 11:20 am
Categories
Apple
PHP
Comments
014 (Now closed)

014 Comments

001

Thanks Shaun!

Author
Brian Delicata
Posted
Dec 4th, 2006 12:26 pm
002

When I launch http://localhost:8888/headdressed/ it’s generating “headdressed.html”, but it’s not launching it, and when I manually do it, the file is empty.

I’ve tried both having sites created in Headdress, as well as NO sites created in Headdress. Also, having Headdress’s default location in User/Sites/ and Applicaitons/MAMP/htdocs/.

Anyway, I was wondering if I’m just missing something obvious. I really like the idea, and would love to implement it, but something doesn’t like me… :-) Any and all help would be much appreciated.

Author
Adam Farnsworth
Posted
Dec 4th, 2006 12:38 pm
003

I don’t know an integrated solution, but simply using MAMPP with your netinfo machines you can create as many hosts as you would like on the same port (using virtual hosts). This required making a virtual host container for each site, but gives great flexibility to your sites - and you can use domain names instead of ‘localhost’.

I use this method on my powerbook, and whenever I need to add a new site, I can set it up with the actual production domain name (and re-route with the hosts file to check loopback first), or a made up domain just for testing. However, I could also use localhost if I prefer. Then, I can port administration sections to each of these sites accordingly (like phpmyadmin or others). So, instead of localhost:4545 as a website, I would use shauninman.com - and have a general admin section at port 2222 or something else.

Long winded, but I think using the virtual hosts containers makes maintenance much easier versus porting out different sites. Then again, I don’t use quicksilver - so maybe I am not at liberty to give input.

Author
Nate K
Posted
Dec 4th, 2006 12:44 pm
004

I too love that combo, though I’ve had some small problems, with MySQL not recognized at localhost. But it worked itself out somehow.

Thanks for the tool!

Author
Mikkel
Posted
Dec 4th, 2006 12:48 pm
005

Adam, I’m not sure what the problem might be. Try adding:

error_reporting(E_ALL);

to the top of index.php. If it can’t find your MAMP httpd.conf you can change the location with the $in variable on line 4.

Author
Shaun Inman
Posted
Dec 4th, 2006 12:58 pm
006

I did a trackback here tim-adler.com/post/mysql-verbindung-mit … -datenbank with a little different tip about MAMP. German though.

Author
Tim Adler
Posted
Dec 4th, 2006 1:10 pm
007

Worth looking at DNS enabler. Really easy to use and cheap to boot.

For my sins I’m using an IIS server in parallels, without DNS on it and using this as my dns server. Its super quick and really flexible. http://cutedgesystems.com/software/DNSEnabler

Marc

Author
Marc McHale
Posted
Dec 4th, 2006 1:58 pm
008

Yeah, so I’m an idiot…

Shaun, thanks for the reply, but it turned out to be that I hadn’t selected the httpd.conf file in MAMP. Thus no sites to link to. Extreme user error… :-)

Author
Adam Farnsworth
Posted
Dec 4th, 2006 2:00 pm
009

TurboGears has a nice snippet of code that adds your site to Bonjour when you start it. Then you can just pull down the site from the Bonjour button in your Safari/Camino toolbar. You have to have Bonjour Bookmarks enabled in Safari’s preferences. Look at def start_bonjour() to see how they do it.

Author
stubblechin
Posted
Dec 4th, 2006 5:10 pm
010

I’ll have to give that a shot. We started using Headdress a while ago to manage our local testing but I hadn’t thought to use Quicksilver with it. If you like Headdress for PHP/MySQL sites, Locomotive is a similar (and opensource) app for local testing of Ruby on Rails sites. I guess the acronym for that would be MLMR (Mac Lighty MySQL Ruby on Rails), which sounds much better than the LAMR production environment we use.

Author
Jason Beaird
Posted
Dec 5th, 2006 9:03 am
011

Very nice stuff, Shaun! All my fave apps :)

Author
Gordon Mackay
Posted
Dec 5th, 2006 1:35 pm
012

Could you not just bookmark them with del.icio.us and use the del.icio.us quicksilver plugin

Author
George Smith
Posted
Dec 6th, 2006 4:42 am
013

This may seem like a rather circuitous solution but until there’s a native integrated solution it gets the job done without having to manually maintain a list of bookmarks.

Author
Shaun Inman
Posted
Dec 6th, 2006 8:43 am
014

Awesome! Works like a charm. An additional tip: Quicksilver has an “Open URL with…” action that is not (at least on my copy) available by default. In the Quicksilver prefs go to: preferences, then actions on the left, then URLs, click the checkbox “Open URL With…”. This is handy for browser testing a site in something other than your default browser.

Thanks for sharing this Shaun.

Author
Nate Steiner
Posted
Dec 11th, 2006 8:42 pm