title: Virtual Host With SSL Support on OS X Mavericks
body: <p>I have a few virtual hosts setup on my local dev machine running Apache/2.2.24 on OS X 10.9 (Mavericks).</p>
  
  <p>My http-vhosts.conf file (that is configured to load through httpd.conf looks like this:</p>
  
  <pre><code>NameVirtualHost *:80
  
  &lt;VirtualHost *:80&gt;
     DocumentRoot "/Library/WebServer/Documents"
     ServerName localhost
  &lt;/VirtualHost&gt;
  
  &lt;VirtualHost *:80&gt;
     DocumentRoot "/Users/me/Sites/testsite.com
     ServerName testsite.dev
  &lt;/VirtualHost&gt;
  
  &lt;VirtualHost *:80&gt;
     DocumentRoot "/Users/me/Sites/testsite2.com
     ServerName testsite2.dev
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>I have also configured my /etc/vhosts file to contain this line:</p>
  
  <pre><code>127.0.0.1       testsite2.dev
  </code></pre>
  
  <p>I want to be able to use the testsite2.dev over SSL (https).  I have tried multiple configurations of the vhosts config file with no luck.</p>
  
  <p>With this current configuration, going to <a href="http://testsite2.dev" rel="noreferrer">http://testsite2.dev</a> pulls up the page I expect while <a href="https://testsite2.dev" rel="noreferrer">https://testsite2.dev</a> points to the apache home page at /Library/WebServer/Documents/index.html.en</p>
  
  <p>I have tried the following configuration, and multiple others, that do not work:</p>
  
  <pre><code>NameVirtualHost *:80
  NameVirtualHost *:443
  
  &lt;VirtualHost *:80&gt;
     DocumentRoot "/Library/WebServer/Documents"
     ServerName localhost
  &lt;/VirtualHost&gt;
  
  &lt;VirtualHost *:80&gt;
     DocumentRoot "/Users/me/Sites/testsite.com
     ServerName testsite.dev
  &lt;/VirtualHost&gt;
  
  &lt;VirtualHost *:80 *:443&gt;
     DocumentRoot "/Users/me/Sites/testsite2.com
     ServerName testsite2.dev
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>Is it possible to have a virtual host listen on port 80 and port 443 on a local machine?</p>