For Brew driven MAMP with Apache2, PHP 5.3 and MySQL 5.x
Install brew (assuming that you have Xcode installed).
$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
Install git and bash completion.
$ brew install git
$ brew install bash-completion
Install dnsmasq for local wildcard domain.
$ brew install dnsmasq
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
$ sudo cp -fv /usr/local/opt/dnsmasq/*.plist /Library/LaunchDaemons
$ sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
Edit your dnsmasq.conf and add an entry for your local development domain. At Good Old we generally use the develpers first name or nick as top level domain. That way we can check out each others work without having to change the IP for *.dev or a similarly generic domain. For me that would be:
address=/.linus/127.0.0.1
You can also add your colleagues like this:
address=/.anders/192.168.4.123
Restart dnsmasq to let the configuration changes take effect.
$ sudo launchctl stop uk.org.thekelleys.dnsmasq
$ sudo launchctl start uk.org.thekelleys.dnsmasq
Install mysql and follow the instructions:
$ brew install mysql
Open the apache config:
$ subl /etc/apache2/httpd.conf
...uncomment the following:
LoadModule php5_module libexec/apache2/libphp5.so
...and add the following (it doesn't have to be located in ~/Sites):
# add this at the end of the file
Include /Users/[USERNAME]/Sites/apache.conf
Create the apache.conf file:
$ touch ~/Sites/apache.conf
...and add the following contents:
# get the server name from the Host: header
UseCanonicalName Off
# include the server name in the filenames used to satisfy requests
VirtualDocumentRoot /Users/[USERNAME]/Sites/%0/public_html
<Directory "/Users/[USERNAME]/Sites">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
allow from all
</Directory>
...and restart.
$ sudo apachectl graceful
Now you should have a working XAMP stack. Just add a "domain.linus" directory to ~/Sites with a public_html dir inside and it will be available as a local site.
Now create a password for your MySQL root user. See here for instructions.
Visit this page for a detailed Guide to Install Apache, MySQL and PHP on Mac OSX via Homebrew