我想在apache(apache 2.2.22和openssl 1.0.1,debian 7.6)上用自己的ssl证书配置两个虚拟主机。我找到了许多有关SNI的文章,但仍然无法正确配置它。这是我的配置:
ports.conf
NameVirtualHost *:80
NameVirtualHost *:443
Listen 80
<IfModule mod_ssl.c>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
test1-ssl
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName test1.com
DocumentRoot /var/www/test1
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/test1.crt
SSLCertificateKeyFile /etc/apache2/ssl/test1.key
</VirtualHost>
</IfModule>
test2-ssl
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName test2.test.pl
DocumentRoot /var/www/test2
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/test2.crt
SSLCertificateKeyFile /etc/apache2/ssl/test2.key
</VirtualHost>
</IfModule>
域https://test1.com可以正常工作(带有其自己的证书)。域https://test2.test.pl显示域test1.com的内容,并使用test1 ssl证书代替test2.crt(因为它在配置文件test2-ssl中定义)。任何想法,建议表示赞赏。
亲切的问候,并在此先感谢!
经过更多的搜索之后,事实证明这是可能的(https://www.digicert.com/ssl-support/apache-multiple-ssl-certificates-using-sni.htm)。我唯一的问题是两个单独的域配置文件...当我在一个配置文件中为域配置虚拟主机时,它起作用了。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句