title: hosting multiple SSL certs on apache
body: <p>I hope someone can give me a hand with this. I have 2 IPs that I can use to do this and need to host 2 different secure (SSL) domains on the same Apache server. I've read that as of Apache 2.2.something that a single IP can be used, using some sort of add-in but I want to keep this as simple as possible and am willing to use both IPs to accomplish this task. I already have the 2 signed certificates for the domains.</p>
  
  <p>This setup that I am posting here, works, but the issue I am having is that when I go to domain2.net, I receive a browser warning telling me that the cert does not match the domain but matches domain1.com</p>
  
  <p>I'm using CentOS 5 and Apache 2.2.3. CentOS has a ssl.conf file and these lines are what I believe are giving me trouble:</p>
  
  <pre><code>SSLCertificateFile /etc/pki/tls/certs/domain1.com.crt
  SSLCertificateKeyFile /etc/pki/tls/private/domain1.com.key
  </code></pre>
  
  <p>I was under the impression that I could override these values in the virtual host containers and reference the keys that I need but it doesn't appear that way. When I comment these two lines out in the ssl.conf file, Apache won't restart. The ssl_log hints: <code>SSLCertificateKeyFile</code></p>
  
  <p>These are my virtual containers:</p>
  
  <pre><code>&lt;VirtualHost 2.2.2.2:443&gt;
     SSLEngine on
     SSLCertificateFile /etc/pki/tls/certs/domain2.net.crt
     SSLCertificateKeyFile /etc/pki/tls/private/domain2.net.key
  
    DocumentRoot "/var/www/domain2"
     ServerName domain2.net
     ServerAlias domain2.net
     DirectoryIndex "index.php"
  
     &lt;Directory /var/www/html/domain2&gt;
       Options -Indexes FollowSymLinks
       AllowOverride All
       Order allow,deny
       Allow from all
     &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  
  
  &lt;VirtualHost 1.1.1.1:444&gt;
     SSLEngine on
     SSLCertificateFile /etc/pki/tls/certs/domain1.com.crt
     SSLCertificateKeyFile /etc/pki/tls/private/domain1.com.key
  
    DocumentRoot "/var/www/html"
     ServerName domain1.com
     ServerAlias domain1.com
     DirectoryIndex "index.php"
  
     &lt;Directory /var/www/html&gt;
       Options -Indexes FollowSymLinks
       AllowOverride All
       Order allow,deny
       Allow from all
     &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>How can I get these two domains to work using SSL? I've also tried to use the same port for the different IPs but again, Apache won't restart.</p>
  
  <p>I'm truly lost on this so if someone could lend a hand, I'd really appreciate it.</p>