Virtual Hosts for MAMP not working correctly (3 posts)

  1. mnicki_mouse
    Posted 3 years ago #

    I'm trying to set up virtual hosts so I can place my local WordPress site files in directories outside of MAMP's htdocs. I followed these instructions verbatim, and it didn't work: http://sawmac.com/mamp/virtual/. Then I found this and tried making some adjustments, but it still isn't working for me: http://wordpress.org/support/topic/running-multiple-local-test-sites-on-mamp.

    My etc/hosts file looks like this:

    # Host Database
    # localhost is used to configure the loopback interface
    # when the system is booting.  Do not change this entry.
    ##       localhost broadcasthost
    ::1             localhost
    fe80::1%lo0     localhost       localhost.mysite

    The bottom of my apache httpd.conf file looks like this:

    NameVirtualHost *
    <VirtualHost *>
    DocumentRoot "/Applications/MAMP/htdocs"
    ServerName localhost
    <VirtualHost *>
    DocumentRoot "Users/myname/Documents/Sites/mysite"

    I would appreciate any help troubleshooting this. Thanks.

  2. s_ha_dum
    Posted 3 years ago #

    I have never used MAMP to build virtual hosts but I do notice that your edits do not look what is described in your first link.

    1) localhost.mysite is not what is described. The instructions are to use something like clientA.local Try something like that-- your sitename followed by ".local". The word 'localhost' is automagical. It may be screwing things up. And the .local is something I've seen in other MAC networking contexts.

    2) Your second "VirtualHost" does not have a "ServerName" component, as described in that first link you provided. I am sure you need one.

  3. mnicki_mouse
    Posted 3 years ago #

    Oops! It is fixed and working now. Thanks for helping, even when I missed something obvious.

Topic Closed

This topic has been closed to new replies.

About this Topic