I was trying to set up a virtual host in apache on my CentOS6 server that handles queries of a subdomain.
Let's say, I have the domain 'example.com'. Now, I want to create the sub domain test.example.com that serves another html page than the main domain.
I searched already for some instructions to do that, especially on apache.org and there were plenty of them, but no one worked.
The problem is: Whenever I visit test.example.com in my browser, I get the main page that is served by example.com althought DocumentRoot points to another directory.
I even tried this a minimal httpd configuration file containing nothing but the following code, but with no success.
Listen 80
<VirtualHost *:80>
ServerName example.com
DocumentRoot /www/main
</VirtualHost>
<VirtualHost *:80>
ServerName test.example.com
DocumentRoot /www/test
</VirtualHost>
Have you an idea what the problem could be?