Last time I tried setting up name based virtual hosting on my development machine I just gave up and mapped websites to different ports. This time, I'm trying to do it right :)!
I've properly registered DNS entries and sending two different headers to the server:
Host: dev.site1.com
Host: dev.site2.com
However, Apache is giving me a hard time with mapping dev.site2.com to dev.site1.com
Here's my slimmed down config:
Listen 80
ServerName localhost:80
NameVirtualHost *:80
<VirtualHost *>
ServerName dev.site1.com
DocumentRoot /www/site1
</VirtualHost>
<VirtualHost *>
ServerName dev.site2.com
DocumentRoot /www/site2
</VirtualHost>
I've tried combos such as (to no effect):
ServerName site1.com
ServerName site2.com
ServerName site1.com
ServerAlias *.site1.com site1
ServerName site2.com site2
ServerAlias *.site2.com site2
I'm happily running Apache 2.2 and hope there's some whose tackled with the same before and can help me out.