Zscorp
Zscorp

Reputation: 13

Amazon Lightsail Install Godaddy SSL Certificate

i have got SSL Certificate from GoDaddy and i want to use it with Amazon Lightsail server can someone pls guide me? i have tried to keep inside apache but still it shows me amazon ssl certificate instead of GoDaddy. i went through their documentation but no luck i followed what they have mentioned there still does not work. most of the documentation focuses on lets encrypt ssl rather then general one.

i would really appreciate if someone had fixed this issue and help me on this. thanks a lot in advance.

Upvotes: 0

Views: 4581

Answers (1)

Pritam Mullick
Pritam Mullick

Reputation: 226

https://in.godaddy.com/help/request-my-ssl-certificate-562 - Follow this to Request a new SSL Certificate of your preferred type.

While requesting your SSL Certificate, your Private Key and certificate signing request (CSR) will appear below your domain name, preserve that somewhere, we are going to need the Private Key later.

Next steps is to go ahead and verify the domain. If you're domain is also from GoDaddy, it would be a little easier.

Once all verification is done, you must see this screen: certificate details

Now, unzip the downloaded zip, you must see 3 files as shown below: certificate files in the downloaded zip

Now Connect to AWS Lightsail using SFTP tutorial and upload your certificate (for our example, it is 83ab9f3f34d95df1.crt file) to the /opt/bitnami/apache2/conf/ directory.

Now follow the steps:

  1. Open a Browser SSH console of your Lightsail instance
  2. cd /opt/bitnami/apache2/conf/
  3. nano private-key.key
  4. Paste your Private key that was generated while we requested the certificate
  5. Save the file Ctrl + X or Cmd + X, then press y
  6. Now we have everything ready, just need to configure the Apache
  7. nano /opt/bitnami/apache2/conf/bitnami/bitnami.conf to edit the bitnami configuration
  8. Modify your Virtual host
     
      DocumentRoot "/opt/bitnami/apache2/htdocs"
    
      #CHANGED - ADDED THIS
      #I added the below 3 lines to enforce HTTPS
      RewriteEngine On
      RewriteCond %{HTTPS} !=on
      RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]
    
      
      ...
  1. Comment the previous certificate key configuration and add your own ones.
    
      DocumentRoot "/opt/bitnami/apache2/htdocs"
      SSLEngine on
    # commented the existing configs
    #SSLCertificateFile "/opt/bitnami/apache2/conf/server.crt"
    #SSLCertificateKeyFile "/opt/bitnami/apache2/conf/server.key"
     SSLCertificateFile "/opt/bitnami/apache2/conf/.cert"
     SSLCertificateKeyFile "/opt/bitnami/apache2/conf/.key"
     
      
      ...
  1. Check configuration apachectl configtest

  2. Restart your server, to take effect,

sudo /opt/bitnami/ctlscript.sh restart apache

Upvotes: 3

Related Questions