mickyginger — 2013-11-16T12:37:12-05:00 — #1
So I'm just setting up my new MacBook with a LAMP stack. I've set my home directory to ~/Sites.
Now I want to set up virtual hosts so I can point urls to different document roots.
So lets say I have a folder in my Sites directory named MySite.
In /etc/hosts I add the following line:
Then in /etc/apache2/extra/httpd-vhosts.conf, I add:
And hey presto, when I navigate to http://mysite.dev, I get the folder contents of ~/Sites.
Not sure what I've done wrong... I've restarted apache, so its not that. Any ideas?
mickyginger — 2013-11-18T17:22:48-05:00 — #2
OK, so I just thought I'd update the post with the solution in case anyone else has the same problem.
In the httpd.conf file (/etc/apache2/httpd.conf) uncomment the line:
# Virtual hosts
It's right near the bottom.
ralphm — 2013-11-18T17:28:25-05:00 — #3
Thanks for posting the solution. I was following this thread, but couldn't find a solution myself.