I've been struggling with this one for hours and must have a really simple error!
I'm setting up an EC2 server and thus I've create 2 sub-domains from my currently live site and pointed the A records to the IP of my EC2 server.
on EC2 server I've got Apache in and running and the root website is running fine. However, my second site, which I'm using a vhosts definition shows the root site.
I then changed both sites to use vhosts and the root site to point to an empty directory and tried reversing the order of the definitions but it always displays the original root site.
Here are the specifics. sub-domain1.some-domain.com uses /var/www/html sub-domain2.some-domain.com should use /var/www/admin
extract from /etc/httpd/conf/httpd.conf
ServerName server2.some-domain.com UseCanonicalName On DocumentRoot "/var/www/dummy" NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot /var/www/admin ServerName subdomain2.some-domain.com </VirtualHost> <VirtualHost *:80> DocumentRoot /var/www/html ServerName subdomain1.some-domain.com </VirtualHost>
Any pointers would be much appreciated.