I'm investigating the configuration of Name-based virtual hosts, under apache, for the provisioning of a main domain, and its sub-domain. I've found one example on the web that suggests a configuration as follows:
Listen 80
NameVirtualHost *
<VirtualHost *>
ServerName www.domain.com
DocumentRoot /home/httpd/htdocs/
</VirtualHost>
<VirtualHost *>
ServerName subdomain.domain.com
DocumentRoot /home/httpd/htdocs/subdomain/
</VirtualHost>
which makes sense until the DocumentRoot
directives. Am I correct in saying that it's less than wise to have one virtual hosts's document root, a descendant of another? Doesn't that configuration mean that the "subdomain" directory will server up content at both domains?