apache-2.2 – 在端口443上添加多个VirtualHost时发出警告 – “_default_ VirtualHost在端口443上重叠,第一个优先”

apache-2.2 – 在端口443上添加多个VirtualHost时发出警告 – “_default_ VirtualHost在端口443上重叠,第一个优先”
我正在运行Ubuntu 12.10,我在/etc/apache2/apache2.conf中有以下4个VirtualHost条目

4个VirtualHost条目适用于2个独立站点:test.example.com和test2.example.com,每个站点一个用于HTTP,一个用于HTTPS.

<VirtualHost *:443>   DocumentRoot /var/www/test   ServerName test.example.com   # Other settings goes here</VirtualHost><VirtualHost *:80>   DocumentRoot /var/www/test   ServerName test.example.com   # Other settings goes here</VirtualHost><VirtualHost *:443>   DocumentRoot /var/www/test2   ServerName test2.example.com   # Other settings goes here</VirtualHost><VirtualHost *:80>   DocumentRoot /var/www/test2   ServerName test2.example.com   # Other settings goes here</VirtualHost>

我的问题
当我保存重启apache时,我收到此警告: –

* Restarting web server apache2[Sun Feb 17 18:30:09 2013] [warn] _default_ VirtualHost overlap on port 443, the first has precedence ... waiting [Sun Feb 17 18:30:10 2013] [warn] _default_ VirtualHost overlap on port 443, the first has precedence

当我打开test.example.com和test2.example.com时,我得到了/ var / www / test的内容

知道问题是什么吗?

您需要添加NameVirtualHost *:443才能工作.
NameVirtualHost *:80也必须在你的配置中,它可能是默认设置的,但我不使用Ubuntu所以我不确定在哪个文件中.

另外一条忠告:在单个IP上运行多个HTTPS站点可能有它的缺点,特别是旧客户端(IE8 / Windows XP)不支持SNI.它可能在您的情况下非常有意义(仅用于测试,* .example.com正在使用通配符证书等),但您应该知道这一点.

免责声明:本网信息来自于互联网,目的在于传递更多信息,并不代表本网赞同其观点。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,并请自行核实相关内容。本站不承担此类作品侵权行为的直接责任及连带责任。如若本网有任何内容侵犯您的权益,请及时联系我们,本站将会在24小时内处理完毕。
相关文章
返回顶部