MAMP host & vhosts

You Must Use the MAMP files, NOT the Apple default system versions!

  1. Update the hosts file in /etc/hosts
    add: newsitename.local
  2. Create a vhost in: /Applications/MAMP/conf/apache/extra/httpd-vhost.conf
  3. In this file: /Applications/MAMP/conf/apache/httpd.conf
    Uncomment this line
    #Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
  4. Then in httpd-vhosts.conf, add a default localhost vhost, AND any new sites you need:
<VirtualHost *:80>
    DocumentRoot "/Applications/MAMP/htdocs"
    ServerName localhost

<VirtualHost *:80>
    DocumentRoot "/Applications/MAMP/htdocs/newsitename"
    ServerName newsitename
    ServerAlias newsitename
    ErrorLog "logs/"
    CustomLog "logs/" common

Then check via Terminal:
cd /Applications/MAMP/Library/bin
apachectl -S


If you’re using these, they’re not going to work!

If you’re pointing to a WordPress, you’ll have to update domain values in the database, and possibly wp-content.php for it not to forward after the server logic, to the values in the db!

Leave a Reply

You must be logged in to post a comment.