How to host multiple websites with MAMP Pro and DynDNS

25th July, 2008, 9 About the author
Ben Vallack is a web developer and filmmaker.

Tags: php, hosting, lamp, mamp, dyndns

I've been trying to set up a system on my local machine that enables me to have multiple sites running as virtual hosts, each with it's own public URL so I can show clients etc before actually putting it on a remote server. The solution I soon realised would be MAMP Pro in conjunction with DynDNS.

However I couldn't quite work out how to set it up to work with multiple hosts. I got a domain in DynDNS pointing to my IP address but it would only show the default host set up in MAMP. I thought the wildcard subdomain on the DynDNS domain would correspond with the name of the host in MAMP. However, they all just showed the default host.

It turns out that you need to set up individual domain hosts in DynDNS and then use the full url of those in MAMP Pro as the name of the host (or just as an alias). For example, lets say you have two hosts in MAMP Pro, one called test and one called test1. In DynDNS you need to set up two hosts, you can call them whatever you like but lets say you choose test.dyndns.info (the second part can be one of several choices if you have a free account) and test1.dyndns.info. You will then need to add an alias to your hosts in MAMP Pro and call them test.dyndns.info and test2.dyndns.info for your respective hosts.

That's it - simple once you know but I couldn't find this piece of info anywhere!

Comments RSS

  1. 1 axelator

    axelator
    7th April, 2009

    Cool, thanks for the info! I am trying to do a similar thing, host my own site through DYNdns. Thanks again.
  2. 2 Nigel

    Nigel
    30th July, 2009

    Hi Ben,

    How exactly does one add an alias to your host in MAMP. I dont have Pro.

    Regards,

    Nige
  3. 3 Andy White

    Andy White
    31st August, 2009

    Thanks! Works like a charm and was exactly what I was looking for.
  4. 4 Scott

    Scott
    28th October, 2009

    This only redirects on my local box. Can you share your Mamp Pro settings?
  5. 5 Shane Robinson

    Shane Robinson
    9th December, 2009

    Thanks so much for this info. I've used MAMP Pro for a couple years but only for internal dev. Using DynDNS is so much easier than updating all the /etc/hosts files of all our desktops and laptops.
  6. 6 BFTQ

    BFTQ
    9th January, 2010

    Thank you for this. So simple!
  7. 7 Steve

    Steve
    1st March, 2010

    I've been looking high and low for this!!!!! Life saver!!!!
  8. 8 Eric Bolikowski

    Eric Bolikowski
    29th April, 2010

    Many thanks! Very useful, and indeed so simple. I searched the MAMP Manual FAQ for this, to no avail. Your recipe should really be added there!
  9. 9 Mike Howell

    Mike Howell
    8th May, 2010

    Thanks for your help. The way I set mine up is my D-Link router serves as the client and it has my <mydomain>.dyndns.com as the host so I can use it for more than just my iMac. Thus I use the wildcard solution and only have <mysite>.<mydomain>.dyndns.com as the alias and only one site in the dyndns host entry using wildcards.

    Works a treat. It is a little long but it allows a bit more flexability without having to have dyndns clients going on each pc. I can just port forward stuff and the alias trick works fine for web hosting my client's sites during development.