How do I configure virtual hosts file to support multiple development websites?
Posted on 2009-02-14
I'm trying to configure my OS X machine as a local development machine. I'm developing for several websites and want to associate dev.<domain>.com with my local apache server.
My hosts file has been modified to include all the hosts
# Host Database
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
Those domains now resolve to my local server, but I want to associate each of those sites with a specific directory, say /htdocs/site1, /htdocs/site2, etc.
I've successfully associated one domain at a time with the correct directory, but I can't figure out the syntax to get them all working at the same time.
Here is the virtual host statement from my httpd.conf file:
If I comment out that statement then all the domains in the hosts file go to the web root directory.
How do I get all the domains pointed to the right directory?