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.
- Unzip headdressed.zip and move the
headdressed
folder to/Applications/MAMP/htdocs
- 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.) - 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. - (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 updatedheaddress.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.
014 Comments
Thanks Shaun!
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.
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.
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!
Adam, I’m not sure what the problem might be. Try adding:
to the top of
index.php
. If it can’t find your MAMPhttpd.conf
you can change the location with the$in
variable on line 4.I did a trackback here tim-adler.com/post/mysql-verbindung-mit … -datenbank with a little different tip about MAMP. German though.
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
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… :-)
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.
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.
Very nice stuff, Shaun! All my fave apps :)
Could you not just bookmark them with del.icio.us and use the del.icio.us quicksilver plugin
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.