title: Apache httpd virtual host SSL Certificate
body: <p>I'm setting up Apache as a reverse proxy giving https access to a service hosted on our intranet.</p>
  
  <p>Apache httpd is running, and i've set up a virtual host as below.</p>
  
  <pre><code>NameVirtualHost *:443
  
  &lt;VirtualHost *:443&gt;
      ServerName my.domain.com
  
      SSLEngine On
      SSLCertificateFile /etc/pki/tls/certs/my.domain.com.crt
      SSLCertificateKeyFile /etc/pki/tls/private/mykey.key
  
      ProxyPreserveHost On
      ProxyPass / http://128.0.0.120:8083/
      ProxyPassReverse / http://128.0.0.120:8083/
  
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>I've generated a self signed certificate, and placed the files in /etc/pli/tls/cert/... as above, however when I browse to this page, i'm informed about the self signed certificate for the machine name, not the one specified in the VirtualHost. The certificate for the machine name is included by <code>/etc/httpd/conf.d/ssl.conf</code> by the line <code>SSLCertificateFile /etc/pki/tls/certs/localhost.crt</code> this is all in the <code>&lt;VirtualHost _default_:443&gt;</code> section.</p>
  
  <p>I was expecting my more specific VirtualHost to override the <em>default</em> settings, however it appears this is not the case. What should I do to correctly override the SSLCertificateFile instruction.</p>
  
  <p>Thanks</p>