Support » Localhost Installs » Virtual Hosts for MAMP not working correctly

  • 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: Then I found this and tried making some adjustments, but it still isn’t working for me:

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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.

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Virtual Hosts for MAMP not working correctly’ is closed to new replies.