Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do you configure MAMP to manage/host multiple websites at one time for development?

share|improve this question

closed as off-topic by HopelessN00b, Ward, mdpc, fuero, Jenny D Mar 21 at 11:40

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions should demonstrate reasonable business information technology management practices. Questions that relate to unsupported hardware or software platforms or unmaintained environments may not be suitable for Server Fault - see the help center." – HopelessN00b, Ward, fuero, Jenny D
If this question can be reworded to fit the rules in the help center, please edit the question.

I don't have the reputation to comment, but I just want to point out that according to this you want to avoid editing the conf files with TextEdit: Virtual hosts with MAMP – Yarin Nov 23 '10 at 18:11
I've had no problems editing it with TextEdit – philfreo Nov 23 '10 at 20:28
Re: textedit- Depends on what’s in the user directory. Some things don’t do well with rtf; just set textedit to ‘plain text’. – user73255 Mar 5 '11 at 22:52
you have to turn off the web sharing in system preferences – user76236 Mar 29 '11 at 4:48
up vote 30 down vote accepted

Change your default listening port

Go to MAMP > Preferences > Ports and set Apache Port to be 80. Press okay.

Set up your local hosts file

Edit your hosts file so that you have some domains that will resolve to your local web server.

From Terminal, type sudo pico /etc/hosts and type your password. At the bottom, append the following two lines.

Save the file and exit (Ctrl+O, enter, Ctrl+X).

Add Virtual Hosts to your Apache configuration

Open up /Applications/MAMP/conf/apache/httpd.conf in a text editor, scroll down, and add the following lines to the file.

NameVirtualHost * 

<VirtualHost *> 
DocumentRoot "/Applications/MAMP/htdocs" 
ServerName localhost 

<VirtualHost *> 
DocumentRoot "/Users/YOURNAME/sites/example-a" 

<VirtualHost *> 
DocumentRoot "/Users/YOURNAME/sites/example-b" 

Restart Apache

Stop Servers and then Start Servers on MAMP. Now you should be able to visit: and

share|improve this answer
I registered in serverfault just to upvote your answer! :D – evilReiko Jun 22 '11 at 11:23
Me too. This is amazing, because you don't have to buy MAMP Pro (which is kind of expensive) for managing multiple sites locally just by editing two config files. – mav May 24 '12 at 9:34
For access forbidden error, go here:… – zengr Dec 10 '12 at 19:34
There is a specific file for virtual host configs located here: /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf – Bryan Downing Mar 7 '13 at 1:11
@BryanDowning It's worth mentioning that in order for apache to use this file you have to uncomment the following line from within httpd.conf file: Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf – Big Joe Mar 13 '13 at 23:06

protected by Chris S Jun 26 '14 at 17:51

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.