title: Configuring MAMP for SSL
body: <p>Ok fellow coders, I am trying to configure MAMP with SSL on my mac for development purposes. I have read and tried the following instructions:<br>
      <a href="http://www.emersonlackey.com/article/mamp-with-ssl-https" rel="noreferrer">http://www.emersonlackey.com/article/mamp-with-ssl-https</a>
      <a href="http://www.webopius.com/content/355/getting-mamp-working-with-ssl-on-os-x" rel="noreferrer">http://www.webopius.com/content/355/getting-mamp-working-with-ssl-on-os-x</a></p>
  
  <p>with no luck. I can hit either <code>127.0.0.1</code> or localhost with http but both <code>https://localhost</code> and <code>https://127.0.0.1</code> return host not found error.  </p>
  
  <p>looking at phpinfo, i can't see mod_ssl being loaded.  </p>
  
  <p>has anyone done this with os x 10.6.7? i have no idea where to go from here. </p>
  
  <p>hope someone can help.</p>
  
  <p>thanks</p>
  
  <p>------edit start------  </p>
  
  <p>the following are the changes i have made to the config files to get https working. Please follow the tuts listed above to get the certificate/key created and the password removed (as also mentioned by <a href="https://stackoverflow.com/a/6380858/102616">@dallas below</a>).</p>
  
  <p><strong>httpd.conf</strong></p>
  
  <p>Comment out the ifdef to make sure LoadModule is executed</p>
  
  <pre><code>#&lt;IfDefine SSL&gt;
      LoadModule ssl_module modules/mod_ssl.so
  #&lt;/IfDefine&gt;
  </code></pre>
  
  <p>make sure the following is in the file...</p>
  
  <pre><code>Listen 80
  ServerName localhost:80
  </code></pre>
  
  <p><strong>ssl.conf</strong></p>
  
  <p>Add the following ....</p>
  
  <pre><code>&lt;VirtualHost localhost:443&gt;
      DocumentRoot /Users/myname/Documents/DevProjects/WebdevProjects
      ServerName localhost
      SSLEngine on
      SSLCertificateFile /Applications/MAMP/conf/ssl/server.crt
      SSLCertificateKeyFile /Applications/MAMP/conf/ssl/server.key
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>before the existing </p>
  
  <pre><code>&lt;VirtualHost _default_:443&gt;
  </code></pre>
  
  <p>server.crt and server.key are the newly created ones as per the obove tuts' links.</p>
  
  <p>Comment out  </p>
  
  <pre><code>#&lt;IfDefine SSL&gt; 
  </code></pre>
  
  <p>around line 35 and its closing tag around line 245 to enable the line...  </p>
  
  <pre><code>Listen 443
  </code></pre>
  
  <p>in between, update all certificate references to the newly created files as per the above VirtualHost definition.</p>