How to renew letsencrypt ssl certificate in cent os aws ec2 ?

How to renew letsencrypt ssl certificate in cent os aws ec2 ?

Please go to the folder where you already installed letsencrypt (first time),

path may be,

/etc/letsencrypt in my case.

Inside that You can find a file called letsencrypt-auto.

 

Run the below command inside letsencrypt-auto folder:
./letsencrypt-auto renew

 

 

Could not find letsencrypt-auto folder ?

In my case it is found in /letsencrypt/letsencrypt path

 

You can also use this below find command to search letsencrypt folder:

find / -name “letsencrypt”

here / tells to search from the main directory with the name “letsencrypt”, you will get the search results something like this if it is found in your system,

/letsencrypt
/letsencrypt/letsencrypt
/var/lib/letsencrypt
/var/log/letsencrypt
/etc/letsencrypt
/opt/eff.org/certbot/venv/bin/letsencrypt
/opt/eff.org/certbot/venv/lib/python2.7/site-packages/letsencrypt

 

Note:

Make sure to stop your nginx/apache servers, if you are running any background processes like pm2/forever, then please stop those things as well to renew the ssl letsencrypt certificates without any issue.

 

If you using nginx and node files (say angular applications) then run the below command with the correct path for proper ssl renewal:

sudo certbot certonly –webroot –webroot-path=/usr/share/nginx/html -d DOMAIN.COM -d www.DOMAIN.COM
(or)
./letsencrypt-auto certonly –webroot –webroot-path=/usr/share/nginx/html -d DOMAIN.COM -d www.DOMAIN.COM

 

Then start nginx/apache/pm2/forever whichever you stopped then check the date of the certificate.

You will get the success message similar to this:

Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/YOURDOMAIN.COM-0001/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/YOURDOMAIN.COM-0001/privkey.pem
Your cert will expire on 2019-02-11. To obtain a new or tweaked
version of this certificate in the future, simply run
letsencrypt-auto again. To non-interactively renew *all* of your
certificates, run “letsencrypt-auto renew”
– If you like Certbot, please consider supporting our work by:

 

Note: I tried around 15 days before it expires, in that case it did not renew my existing certificate, it just created the new certificate starting from today to 90 days. Please give the correct folder name in nginx ssl configurations, if similar case happened to you guys as well.

196 total views, 2 views today

About: Mirthbees

Blogger, Innovator, Developer and Enterpreneur. Founder of GuruRecharge, Readymade online recharge script. Lead Developer in Bookrate.in