配置apache有一个奇怪的问题。
我有4个域
我已经为每个域配置了虚拟主机。
mydomain.tld、my-domain.tld和anotherdomain.tld工作正常,但另一个-domain.tld不能正常工作。
Apache似乎正在为anotherdomain.tld选择虚拟主机,并为其服务,而不是另一个-domain.tld。
两个服务器名称都已正确设置。
和
这似乎是唯一可能成为问题的地方。有没有人对找出这一错误的原因有任何建议。
还有几个注意事项:每个虚拟主机都位于不同的文件中。mydomain.tld和my-domain.tld位于anotherdomain.tld和另一个-domain.tld的不同ip地址上。
发布于 2009-09-17 07:02:54
您如何知道web服务器正在服务于anotherdomain.tld而不是另一个-domain.tld?您看到浏览器地址栏中的URL中有anotherdomain.tld吗?
如果您使用复制粘贴技术创建了这些配置,那么您可以为两个域保留相同的DocumentRoot。
另一种猜测是,如果anotherdomain.tld和另一个-domain.tld配置在相同的apache IP地址上,但是另一个-domain.tlpdns "A“记录被设置为不同的IP,则Apache只是提取其配置中指定的IP的默认VirtualHost,可能是anotherdomain.tld。
示例:如果在DNS中有:
anotherdomain.tld -> 1.2.3.12
another-domain.tld -> 1.2.3.12然后在httpd.conf中:
<VirtualHost 1.2.3.12:80>
ServerName anotherdomain.tld
...
</VirtualHost
<VirtualHost 1.2.3.18:80>
ServerName another-domain.tld
...
</VirtualHost当您在浏览器的地址栏中输入http://another-domain.tld/时,它会向1.2.3.12发出请求,该请求提取1.2.3.12的默认虚拟主机,即anotherdomain.tld。
不过这只是两个疯狂的猜测..。
https://serverfault.com/questions/65818
复制相似问题