我在我的服务器上遇到了我的VirtualHostconfiguration问题。 我的服务器运行Ubuntu 14.04.5 LTS(GNU / Linux 4.4.0-31-generic x86_64),Apache / 2.4.7(Ubuntu)。
我已经从这里的其他线程做了很多关于Apache和SNI的阅读,但是我一直没能解决我的具体问题。
我有几个VirtualHostsconfiguration从不同的域,每个都有自己的SSL证书,如下所示:
<VirtualHost *:80> ServerAdmin [email protected] ServerName mydomain.com ServerAlias www.mydomain.com DocumentRoot /home/user/mydomain.com/public_html ErrorLog /home/user/mydomain.com/logs/error.log CustomLog /home/user/mydomain.com/logs/access.log combined </VirtualHost> <VirtualHost *:443> ServerAdmin [email protected] ServerName mydomain.com ServerAlias www.mydomain.com DocumentRoot /home/user/mydomain.com/public_html ErrorLog /home/user/mydomain.com/logs/error.log CustomLog /home/user/mydomain.com/logs/access.log combined SSLEngine on SSLCertificateFile /etc/apache2/ssl/mydomain.com.crt SSLCertificateKeyFile /etc/apache2/ssl/mydomain.com.key SSLCACertificateFile /etc/apache2/ssl/mydomain.com.root.crt SSLCertificateChainFile /etc/apache2/ssl/mydomain.com.chain.crt </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] ServerName otherdomain.com ServerAlias www.otherdomain.com DocumentRoot /home/user/otherdomain.com/public_html ErrorLog /home/user/otherdomain.com/logs/error.log CustomLog /home/user/otherdomain.com/logs/access.log combined </VirtualHost> <VirtualHost *:443> ServerAdmin [email protected] ServerName otherdomain.com ServerAlias www.otherdomain.com DocumentRoot /home/user/otherdomain.com/public_html ErrorLog /home/user/otherdomain.com/logs/error.log CustomLog /home/user/otherdomain.com/logs/access.log combined SSLEngine on SSLCertificateFile /etc/apache2/ssl/otherdomain.com.crt SSLCertificateKeyFile /etc/apache2/ssl/otherdomain.com.key SSLCACertificateFile /etc/apache2/ssl/otherdomain.com.root.crt SSLCertificateChainFile /etc/apache2/ssl/otherdomain.com.chain.crt </VirtualHost>
这在大多数情况下都能正常工作,对于大多数浏览器来说,不pipe是在特定设备还是在随机时间,当我尝试转到“otherdomain.com”时,它会尝试获取“mydomain.com”的SSL证书,这会导致networking钓鱼/证书错误错误。
我读到SNI可能是解决scheme,所以我将以下内容添加到了我的Apacheconfiguration中:
<IfModule mod_ssl.c> NameVirtualHost *:443 Listen 443 </IfModule>
然而,在我的Apache(2.4)版本中,似乎也显示出这个特性已经被淘汰了,每当我重新启动Apache,
# service apache2 restart * Restarting web server apache2 AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/ports.conf:17
它似乎也没有纠正这个问题,我仍然收到这个错误。 每次使用旧的黑莓手机,我都可以复制这个问题。
除了必须为使用SSL的每个VirtualHost获取唯一的IP地址,我有什么方法可以解决这个问题?
另外我的例子只显示了2个域,但是我实际上有5个域使用他们自己的SSL证书设置。 当我能够复制问题时,他们都抓住了第一个域的SSL证书。
非常感谢任何帮助。
基于名称的虚拟主机没有被淘汰。 NameVirtualHost设置正在被删除,因为它是多余的。 剩下的configuration将包含足够的信息,以便Apache知道是否必须启用该设置。
此外,SNI不是您可以在服务器端打开或closures的设置。 客户端支持它,并且在发送到服务器的第一个消息中发送SNI字段,或者客户端不支持它,并且服务器没有办法做到这一点。
您的select是: