Articles from Wednesday, 08/22/2007

Local Web Development on your Mac, Part 1
By David Rogers in and

There are quite a few tutorials out there on how to setup your Mac for serving local websites via the built-in Apache 1.x install or a separate install of Apache 2.x running from /usr/local/bin. Most of these have never worked for me, and to complicate this further, I’ve completely hosed my default Apache through various attempts to compile and install v2.x over it (instead of in the aforementioned alternate location). Call me crazy.

For my local development needs, I turned instead to MAMP from living-e AG – a complete Apache 2.x + mySQL 4.x standalone server solution. I highly recommend it to anyone interested in developing locally on your Mac, since mucking around with your default install can lead to undesirable effects (see above). I use the basic MAMP product, not the Pro edition, and this tutorial is designed from that perspective.

First, let me say that I’m splitting this tutorial into pieces, along the lines that I first came to these conclusions. First attempts should always be the simplest, working up to more complex forms, and this tutorial is no exception. I begin with the basic, then add more advanced configurations as we go. Let’s get started, then.

First, download MAMP and install it in the usual manner. Yes, for you cheapskates like me, the non-Pro edition is in the same Disk Image as the Pro edition. You can give MAMP Pro a run-through, if you like, and much of what I’m about instruct you to do isn’t necessary if you use Pro. The latter portions of the tutorial won’t work, however, in Pro – to my knowledge. Feel free to correct me.

It’s important to note that the compiled binaries and widget expect the MAMP folder to reside directly in your Applications folder; moving it elsewhere isn’t recommended (unless you know how to make symlinks). You can play around with the settings some to get a feel for what you’ve got, but the rest of the tutorial assumes that you follow the instructions exactly.

We’re not really concerned with the MAMP control panel, and I always use the widget to start and stop the servers. Still, it’s useful to set the default port for mysqld, the mySQL server process. I usually set this to 8806 instead of 8889, because it makes more sense to me (mysqld normally runs on 3306 by default). Honestly I don’t use the MAMP instance of mySQL much thanks to SSH tunneling, but that’s later.

Well, we’re basically setup for starters. You can usually surf to localhost:8888 (assuming you didn’t change the default Apache port) and see the default MAMP pages served from /Applications/MAMP/htdocs/ (again, unless you changed the default site root). If localhost won’t work for you (I get varying results in Safari 3 ß), try 127.0.0.1:8888, the universal loopback for ethernet.

Great, I’ve told you next to nothing, right? Anybody can basically install a Mac app and run it. Widgets are even less complicated. Well, hold onto your knickers, there’s more to come. You see, since MAMP is a full-fledged Apache install, there’s gotta be an Apache configuration file around somewhere, right? You bet, and we’re messing with that next. On to Part 2

Comment

Commenting is closed for this article.


Search Articles

Categories

News & Bulletins

08/21/07

Hermes is on its way...

Built on Zend Framework for PHP5, Hermes is a RAD Platform that handles some of the basic application logic using components and conventions established in ZF, like basic authentication, model instantiation, and external configurations. More to come as we get closer to launch!

New Site Desgin!

So we finally gave the site a much needed face-lift, and there’s more than just a make-over going on. You’ll note that the site is now published with Textpattern as well! Easier updates mean more frequent updates!