子域configuration由默认configuration覆盖

我试图在apache2中configuration一些子域(没有定义主域),并且在我为某个域编写configuration文件后,启用它,然后尝试加载它,它会显示默认configuration文件(I重新启动apache)。 这是一个子域的虚拟主机

#nameVirtualHost * virtualHost * <VirtualHost subdomain.domain.com> ServerAdmin [email protected] ServerName subdomain.domain.com ServerAlias subdomain.domain.com DocumentRoot /var/www/clients/subdomain <Directory /var/www/clients/subdomain> Options FollowSymLinks AllowOverride All Order allow,deny allow from all </Directory> ErrorLog /var/log/apache2/error_subdomain.com.log LogLevel warn CustomLog /var/log/apache2/access_subdomain.com.log combined ServerSignature Off UseCanonicalName off </VirtualHost> 

在默认configuration文件中,path是'/ var / www'。

我知道这一定是超强的,但是不能赶上。 任何帮助,高度赞赏

提前致谢

使用,假设你想在端口80上使用标准的HTTP:

 nameVirtualHost *:80 

然后在任何VirtualHost部分:

 <VirtualHost *:80> ServerName subdomain.domain.com ... </VirtualHost> 

请参阅http://httpd.apache.org/docs/2.2/vhosts/name-based.html