title: Setup an SSL certificate on an EC2 instance
body: <p>I'm having hard time trying to setup an SSL certificate (it's a Comodo PositiveSSL purshased from NameCheap) on my EC2 micro instance (I'm using Amazon Linux AMI 2012.3, which is based on CentOS if I'm not mistaken).</p>
  
  <p>Here's what I did:</p>
  
  <ol>
  <li><p>I installed mod_ssl &amp; OpenSSL</p></li>
  <li><p>I enabled port 443 on my EC2's instance security group</p></li>
  <li><p>I CHMODed the *.key &amp; *.crt files to 777 as Comodo suggested</p></li>
  <li><p>I'm certain the IP address &amp; files path are correct (put a bunch of
  0s in the example but it <strong>is</strong> correct in my ssl.conf)</p></li>
  <li><p>I added this VirtualHost entry to ssl.conf</p></li>
  </ol>
  
  <hr>
  
  <pre><code>&lt;VirtualHost 00.000.000.00:443&gt;
     ############# I tried both with &amp; without this section ##############
     ServerName www.mydomain.com:443
  
     ServerAlias www.mydomain.com
     DocumentRoot /var/www
     ServerAdmin webmaster@mydomain.com
     ######################################################################
  
     SSLEngine on
     SSLCertificateKeyFile /etc/ssl/mydomain_com.key
     SSLCertificateFile /etc/ssl/mydomain_com.crt
     SSLCertificateChainFile /etc/ssl/mydomain_com.ca-bundle
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <hr>
  
  <p><strong>Then I restarted apache</strong>...but I <strong>stil cannot access</strong> <a href="https://www.mydomain.com/" rel="noreferrer">https://www.mydomain.com/</a> !!!</p>
  
  <p>I checked with <a href="http://ssltool.com" rel="noreferrer">ssltool.com</a>, it says</p>
  
  <pre><code>The Common Name on the certificate is: ip-00-00-00-000
  
  The certificate chain consists of:
  SomeOrganization, ip-00-00-00-000. Expires on: Apr 10 13:39:41 2013 GMT - that's 363 days from today.
  The site tested mydomain.com is NOT the same as the Subject CN ip-00-00-00-000!.
  </code></pre>
  
  <p>I even went &amp; copied the VistualHost to httpd.conf instead of ssl.conf &amp; restarted apache, all in vain.</p>
  
  <p>I've been banging my head against the wall for days now. I'm pretty sure I'm missing a tiny something to make this work, I just don't know what exactly.</p>
  
  <p>I'd be infinitely grateful if someone can suggest something to make this work!</p>