This guide will teach you how to renew your SSL Certificate on an existing AWS EC2 instance.
Generate an SSL Certificate
You can generate a new SSL certificate by either creating a new one or renewing an existing one. If you have an existing SSL certificate that needs to be renewed, generate a new certificate signing request (CSR) and submit it to your certificate authority (CA). In our case, we are using the Comodo Certification Authority’s services. After submitting CSR it will ask for domain verification. There are three ways to verify your domain. You can verify through Email, DNS entry or by HTTP File. Once the CA approves the CSR, you can download the new certificate and key files in Zip format.
Install the new SSL Certificate
Once you have the new SSL certificate and key files, you need to install them on your EC2 instance. Take the new SSL certificates and go to the directory where the Old SSL certificates are stored. Usually, we have our old SSL certificates in the following directory:
Now place the new files of the certificates here and restart the server. Connect to your instance through PuTTY configuration and run these two commands on your terminal.
sudo systemctl restart httpd
sudo apachectl restart
Verify the new SSL Certificate
After you have installed the new SSL certificate, you should verify that it is working correctly. Access your website using HTTPS and check that the SSL certificate is valid and trusted by your browser. Also, verify that the SSL certificate has been updated by checking the certificate details in your browser’s security settings.