Назад | Перейти на главную страницу

настройка нескольких сертификатов ssl на одном сервере / IP на CENTO с apache 2.2

я используя эту ссылку для настройки нескольких сертификатов ssl на одном и том же IP-адресе на CENTOS 6.3 с apache 2.2

<VirtualHost *:443>

        ServerAdmin webmaster@localhost
        ServerName www.domain1.org
        ServerAlias domain1.org
        DocumentRoot /var/www/vhosts/domain1.org/

        #   SSL Engine Switch:                                                                                                                                                                                                   
        #   Enable/Disable SSL for this virtual host.                                                                                                                                                                            
        SSLEngine on

        #   A self-signed (snakeoil) certificate can be created by installing                                                                                                                                                    
        #   the ssl-cert package. See                                                                                                                                                                                            
        #   /usr/share/doc/apache2.2-common/README.Debian.gz for more info.                                                                                                                                                      
        #   If both key and certificate are stored in the same file, only the                                                                                                                                                    
        #   SSLCertificateFile directive is needed.                                                                                                                                                                              
        SSLCertificateFile  /home/tmp/ssl/domain1.crt
        SSLCertificateKeyFile /home/tmp/ssl/domain1.key

</VirtualHost>
<VirtualHost *:443>

        ServerAdmin webmaster@localhost
        ServerName www.domain2.org
        ServerAlias domain2.org
        DocumentRoot /var/www/vhosts/domain2.org/

        #   SSL Engine Switch:                                                                                                                                                                                                   
        #   Enable/Disable SSL for this virtual host.                                                                                                                                                                            
        SSLEngine on

        #   A self-signed (snakeoil) certificate can be created by installing                                                                                                                                                    
        #   the ssl-cert package. See                                                                                                                                                                                            
        #   /usr/share/doc/apache2.2-common/README.Debian.gz for more info.                                                                                                                                                      
        #   If both key and certificate are stored in the same file, only the                                                                                                                                                    
        #   SSLCertificateFile directive is needed.                                                                                                                                                                              
        SSLCertificateFile  /home/tmp/ssl/domain2.crt
        SSLCertificateKeyFile /home/tmp/ssl/domain2.key

</VirtualHost>

при запуске я получаю следующее предупреждение:

[warn] _default_ VirtualHost overlap on port 443, the first has precedence

когда я посещаю разные сайты, мне всегда показывается первый сертификат. в чем дело?

Вам необходимо включить возможность SNI. Включите в ports.conf:

NameVirtualHost *:443