配置:
<VirtualHost sub.domain.com:80>
NameVirtualHost sub.domain.com:80
ServerName sub.domain.com
DocumentRoot /home/colleague/public_html/domain.com/ZendSkeletonApplication/public/
SetEnv APPLICATION_ENV "development"
<Directory /home/colleague/public_html/domain.com/ZendSkeletonApplication/public >
Options Indexes FollowSymLinks Includes ExecCGI
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost bugtrack.sub.domain.com:80>
NameVirtualHost bugtrack.sub.domain.com:80
ServerName bugtrack.sub.domain.com
DocumentRoot /home/colleague/public_html/bugtrack.sub.domain.com/
SetEnv APPLICATION_ENV "development"
<Directory /home/colleague/public_html/bugtrack.sub.domain.com >
Options Indexes FollowSymLinks Includes ExecCGI
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost domain2:80>
NameVirtualHost domain2:80
ServerName domain2.com
DocumentRoot /home/me/public_html
SetEnv APPLICATION_ENV "development"
<Directory /home/me/public_html >
Options Indexes FollowSymLinks Includes ExecCGI
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
错误:
[Wed Jun 18 18:06:44 2014] [warn] NameVirtualHost bugtrack.sub.domain.com:80 has no VirtualHosts
[Wed Jun 18 18:06:44 2014] [warn] NameVirtualHost domain2.com:80 has no VirtualHosts
[Wed Jun 18 18:06:44 2014] [warn] NameVirtualHost *:80 has no VirtualHosts
如果我访问 domain2.com(虚拟域),我会到达 sub.domain.com 。我认为这是因为其他两个虚拟主机有问题。bugtrack 虚拟主机确实加载了 Bug Genie,但新添加的由第三方注册商托管的第二个域不起作用,并导致第一个虚拟主机。当我在 http conf 中取消注释该行时,出现了最后一个错误,因为我认为这可以解决问题。
我该如何修复这个配置并让 domain2 进入我需要的文档根目录?