LetsEncrypt with CertBot Shows Expired Site with Renewed Certificate

Mindwatering Incorporated

Author: Tripp W Black

Created: 09/10/2020 at 12:52 AM

 

Category:
Ubuntu
Configuration Files

Issue:
Certbot Ubuntu package is installed and successfully renewing the certificate. However, since Apache or Nginx are not reloaded the web site still will show an expired certificate.


Solution:

Option 1 - If you have only a single web site,
then add the following line:
(Change if running apache vs nginx.)

Update the LetsEncrypt cli.ini file:
$ sudo vi /etc/letsencrypt/cli.ini

. . .
deploy-hook = systemctl reload nginx

Save:
<esc :wq>


Option 2 - If you have multiple web sites,
then add for the specific app/site:
So assuming your site config file is at: /etc/letsencrypt/renewal/my.domain.conf

$ sudo vi /etc/letsencrypt/renewal/my.domain.conf

Add the following line:
. . .
renew_hook = systemctl try-reload-or-restart servicename

Save:
<esc :wq>





previous page