2

After adding a local virtual host in MAMP PRO (os x lion) everything works as expected. Out of curiosity I had a look at httpd-vhosts.conf file placed in MAMP/conf/apache/extra and to my surprise this is all I can see:

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "/Applications/MAMP/Library/docs/dummy-host.example.com"
    ServerName dummy-host.example.com
    ServerAlias www.dummy-host.example.com
    ErrorLog "logs/dummy-host.example.com-error_log"
    CustomLog "logs/dummy-host.example.com-access_log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "/Applications/MAMP/Library/docs/dummy-host2.example.com"
    ServerName dummy-host2.example.com
    ErrorLog "logs/dummy-host2.example.com-error_log"
    CustomLog "logs/dummy-host2.example.com-access_log" common
</VirtualHost>

It hasn't added my virtual host into the file and I don't even see a path to localhost (but it works!) Does it have to do with the fact that MAMP is using a httpd.conf template? Where is the info about my virtual hosts stored? Can I add virtual hosts manually?

Judith
  • 673
  • 4
  • 18
JaneVi
  • 91
  • 1
  • 5

1 Answers1

7

I've found out I was looking in the wrong place, the right path to httpd.conf for MAMP PRO is ~/Library/Application Support/appsolute/MAMP PRO.

JaneVi
  • 91
  • 1
  • 5
  • If you edit this file are the changes applied to your local web server or do you need to restart Apache first? Also if you restart MAMP then the file is overridden so changes here are temporary. – Evanss Aug 26 '15 at 10:23