我已经在运行apache 2的centos服务器上设置了2个共享相同IP的虚拟主机.
## ServerAdmin webmaster@dummy-host.example.com # DocumentRoot /www/docs/dummy-host.example.com # ServerName dummy-host.example.com # ErrorLog logs/dummy-host.example.com-error_log # CustomLog logs/dummy-host.example.com-access_log common # DocumentRoot /var/www/a ServerName www.a.com ServerAlias a.com DocumentRoot /var/www/b ServerName www.b.com ServerAlias b.com
无论我指向哪个URL.站点A出现.
我该怎么办?我应该有a.com去a和b.com去b.
谢谢大家
您的httpd.conf中是否设置了以下内容?
NameVirtualHost *
文档中的一个示例:
NameVirtualHost *ServerName www.domain.tld DocumentRoot /www/domain ServerName www.otherdomain.tld DocumentRoot /www/otherdomain