title: Apache SNI: multiple SSL certificates on one IP address
body: <p>Today I'm trying to configure Apache to run two domains each with their own SSL certificate. From what I have read this is supported by SNI as long as my Apache is configured with a recent version of OpenSSL. I verified that it is:</p>
  
  <pre><code>[notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.7 with Suhosin-Patch mod_ssl/2.2.22 OpenSSL/1.0.1 configured -- resuming normal operations
  </code></pre>
  
  <p>I thought I had successfully set up the second domain and certificate, but when I try to visit the second domain in chrome I get the following error:</p>
  
  <pre><code>You attempted to reach example2.com, but instead you actually reached a server identifying itself as example1.com.
  </code></pre>
  
  <p>this post seems closest to my issue:</p>
  
  <p><a href="https://stackoverflow.com/questions/5228760/hosting-multiple-ssl-certs-on-apache">hosting multiple SSL certs on apache</a></p>
  
  <p>but from what I can tell my server is already configured correctly (clearly it is not!)</p>
  
  <p>I have the following directives in my conf file for example2.com</p>
  
  <pre><code>ServerName  example2.com
  SSLEngine on
  SSLCertificateFile /etc/apache2/ssl/example2.com.crt
  SSLCertificateKeyFile /etc/apache2/ssl/example2.com.key
  </code></pre>
  
  <p>it looks right to me. so why is apache serving example1's cert when I visit example2?</p>