Setup an SSL certificate on an EC2 instance

Question:

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).

Here’s what I did:

  1. I installed mod_ssl & OpenSSL
  2. I enabled port 443 on my EC2’s instance security group
  3. I CHMODed the *.key & *.crt files to 777 as Comodo suggested
  4. I’m certain the IP address & files path are correct (put a bunch of
    0s in the example but it is correct in my ssl.conf)
  5. I added this VirtualHost entry to ssl.conf


Then I restarted apache…but I stil cannot access https://www.mydomain.com/ !!!

I checked with ssltool.com, it says

I even went & copied the VistualHost to httpd.conf instead of ssl.conf & restarted apache, all in vain.

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.

I’d be infinitely grateful if someone can suggest something to make this work!

Answer:

Sometimes this section

prevents your real SSL certificate from being used. If this is the case either comment VirtualHost default or move the SSLCertificate* attributes to it, ie.

Make sure you restart apache after that.

Leave a Reply