I recently reinstalled my Mac OS so now I have to set up my development environment again. I figured this was a great opportunity to document my settings in case they helped someone else or I needed them later. This article documents how I set up MAMP.
Step 1: Download MAMP and UnZip
Step 2: Walk through the installation steps
Step 3: Go to Applications and Launch MAMP
Step 4: In MAMP go to Preferences > Apache
Change the Document Root folder to your Dropbox Local file folder. You should also make sure you have your Ports set to the default Apache and MySql.
One tricky thing for me is that I need my iMac and my MB Air to be in sync especially with my development sites. I use Dropbox to sync my local site files.
At this point you should have a functional copy of MAMP
However, in order to sync your databases and your httpd and hosts files between your computers to minimize your duplicate tasks follow these additional steps:
You will need this additional tool or be able to create a Symbolic Link in the terminal.
Step 5: Go to
There you will find a folder called db. If this is your first computer then you want to copy that folder to Dropbox. If this is your second computer, then skip that step and open a new Finder window and navigate to where your db folder is located.
Step 6: Create a SysLink for the db folder
If you are using Symbolic Linker, right click on the the db folder and go to Services > Make Symbolic Link or just Make Symbolic Link. Delete the db folder in your Applications/MAMP folder and copy the db SymLink from Dropbox to that folder. Rename it to be just db. Now your Database should sync between your computers.
Note: you cannot have MAMP running at the same time on both computers because it will cause a Dropbox conflict.
Step 7: Hosts and httpd files
I haven’t found a good way to sync my hosts and httpd.conf files, but you will need to change these if you want your local sites to show up like this: chrissmith.loc instead of like this: localhost/chrissmith. It is pretty easy to edit them as necessary even if you have to do it manually on each computer. Your hosts file is located at: ~/etc/hosts and your httpd file is at: ~/Applications/MAMP/conf/apache/. Since my iMac is the better source for these files, I copied the ones from that computer to my Dropbox folder and then now on my MB Air I will just copy the ones from my Dropbox to the local locations on my computer. For the httpd file, I copied the virtual host block from my Dropbox file to the file that was in my MAMP install. If I copied the file itself, Apache stopped working.
Step 8: Flush your cache and GO
Once you have those in place, make sure you shut down your MAMP (close it or just stop the servers). Open up terminal and enter: dscacheutil -flushcache then hit Enter. Now reopen or restart your MAMP server. You should now be able to visit your local sites.
Two problems I have run into with this:
Apache won’t start: See last part of Step 7.
MySQL won’t start: This is the more common one for me. The best solution I have found is to quit MAMP. Go to your Activity Monitor and Force Quit all instances of the process mysqld.