帮助 – 阿帕奇从几乎任何url提供我的网站!

我用Apache,Rails,MySQL等运行Ubuntu 10.04

我的rails站点在www.example.com上运行。 我打算使用基于命名的虚拟主机,并为www.example.comconfiguration/启用虚拟主机文件。 我的网站托pipe在Amazon EC2上。

问题是,如果我build立了一个新的DNSlogging(比如test.example.com)并浏览到该logging,我的网站www.example.com就会发送出去! 这没有configuration任何新的虚拟主机。

如果我去我的DNSlogging和定义test2.example.com等,也是如此。没有接触我的服务器,这些新的URL提供我的网站。

那不是我想要的! 我想使用基于名称的虚拟主机,并为每个子域主持不同的网站。

我的问题在哪里?

这是我的虚拟主机文件:

ServerSignature Off ServerTokens Prod #NameVirtualHost *:80 - this is defined in a default config file already. <VirtualHost *:80> ServerAdmin [email protected] UseCanonicalName On ServerName www.example.com DocumentRoot /home/ubuntu/example/public ErrorLog /home/ubuntu/example/log/error.log <Directory /home/ubuntu/example/public/> AllowOverride all Options -MultiViews </Directory> </VirtualHost> 

如果没有任何匹配的虚拟主机使用,apache将使用它认为是默认的虚拟主机。 如果您想要显示空白页面,请将其设置为第一个虚拟主机,然后定义您的www.example.com条目。