ServerAlias的Apache vhostconfiguration获取默认值

鉴于这种configuration:

NameVirtualHost *:80 Listen 80 <VirtualHost *:80> ServerName default.example.com </VirtualHost> <VirtualHost *:80> ServerName www.example.net ServerAlias testy.example.net </VirtualHost> <VirtualHost *:80> ServerName www.example.org ServerAlias new.example.org </VirtualHost> 

请求www。*按照我的预期提供,.net和.org站点的页面交付。

然而,对于ServerAliases,new.example.org和testy.example.net的请求是从default.example.com

这是在Apache 2.2.22上

/ usr / sbin / apache2 -f -S只显示默认服务器…所以挖掘,进一步挖掘

试试:

 ServerName example.net ServerAlias *.example.net 

OFM

我的例子应该是:

 <VirtualHost *:80> ServerName www.example.net ServerAlias testy.example.net. otherhost.example.net </VirtualHost> 

我的绑定习惯,在那个主机上,在这个上下文中指定带终止点的FQDN将产生一个不可分析的名字。

这里没什么可看的,现在就走吧。