2

I'm using this reference to setup multiple ssl ceritificates on same ip on CENTOS 6.3 with 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>

upon start I receive the following warning:

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

when I visit the different sites, it still always shows me the first cerficicate. what's wrong?

2

You need to enable SNI ability. Enable with in ports.conf:

NameVirtualHost *:443

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.