I currently have one main domain: mydomain.com
This is working fine.
What im trying to do is now adding a subdomain through my mydomain.conf file, so that I can have:
I've tried with the following - however the result of this is that im serving the content from mydomain.com at sub.mydomain.com:
# MY MAIN DOMAIN <VirtualHost *:80> ServerName mydomain.com ServerAlias *.mydomain.com DocumentRoot /var/www/mydomain.com/html </VirtualHost> # DEFINING MY SUBDOMAIN <VirtualHost *:80> ServerName sub.mydomain.com ServerAlias sub.mydomain.com DocumentRoot /var/www/sub/html/ </VirtualHost>
I've naturally created the DocumentRoot for the subdomain at: DocumentRoot /var/www/sub/html/
At my DNS-supplier, i've created an A-record for both: sub.mydomain.com www.sub.mydomain.com - and pointed it to my server IP. (the same IP that mydomain.com is pointing to)
Im running Centos 6.2.
Any ideas what is wrong here?