Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

We have 2 sites hosted on an Apache server. everything with port80 is working fine, but when we try to connect using https we are redirected to the first document directory of port443 regardless of which URL we use. we have a SAN(UCC) SSL certificate that's set up properly for both domains. can any one assist us in finding a solution so https://website2.com does not end up over in https://website1.com

<VirtualHost *:443>
   ServerName website1.com
   DocumentRoot /var/www/website1

<VirtualHost *:443>
   ServerName website2.com
   DocumentRoot /var/www/website2
share|improve this question

1 Answer 1

Common misconfiguration of Apache, as per http://wiki.apache.org/httpd/CommonMisconfigurations#Multiple_SSL_name_based_virtual_hosts_on_the_same_interface :

Because of the nature of SSL, host information isn't used when establishing an SSL connection. Apache will always use the certificate of the default virtual host, which is the first defined virtual host for name-based virtual hosts.

What you want to achieve is called "SNI", is possible only when using a 2.2.12 or later web server, built with 0.9.8j or later OpenSSL and is only compatible with recent browsers.

share|improve this answer
+1 for correct info about SSL handshake. You should use a unique IP address for each domain. –  xofer Dec 17 '11 at 0:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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