Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 5 down vote accepted

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.

share|improve this answer
    
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. – Evans Aug 26 '15 at 10:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.