Moodle - wont renew ssl cert by itself

Keywords: Moodle - Microsoft Azure - Technical issue - Secure Connections (SSL/HTTPS)
bnsupport ID: 66197d3a-c1f3-b412-33f1-5860e42deea8
Description:
Hey,

we are hosting a bitnami certified moodle template in azure.
We tried to configure the bncert tool, that worked fine - but is not autmatically renewing the cert.
We tried that how-to:
https://docs.bitnami.com/azure/how-to/generate-install-lets-encrypt-ssl/

so what are we doing right now?:
sudo /opt/bitnami/ctlscript.sh stop
sudo /opt/bitnami/letsencrypt/lego --tls --email=“it@customer.at” --domains=“domain.customer.at” --path="/opt/bitnami/letsencrypt" renew --days 90
sudo /opt/bitnami/ctlscript.sh start

with that the ssl cert is reconfigured for additional 90 days.
But we are not able to get a cron job running for that.

what are we doing wrong?

Many thanks,
domidetres

Hi @domidetres,

Thanks for using Bitnami. I see in your bnsupport tool that you already have a job configured to renew the certificates. Can you tell us what is the content of the script?

0 0 1 * * /opt/bitnami/letsencrypt/scripts/renew-certificate.sh 2> /dev/null

Can you edit the job to save the output to a log file and check what error do you get?

0 0 1 * * /opt/bitnami/letsencrypt/scripts/renew-certificate.sh 2> /tmp/certificate-renewal.log

Running the script manually can also give you some hints at this moment

sudo /opt/bitnami/letsencrypt/scripts/renew-certificate.sh

Hey @gongomgra,

Content of the script:

#!/bin/bash

sudo /opt/bitnami/ctlscript.sh stop apache
sudo /opt/bitnami/letsencrypt/lego --tls --email="it@customer.at" --domains="domain.at" --path="/opt/bitnami/letsencrypt" renew --days 90
sudo /opt/bitnami/ctlscript.sh start apache

We editet the cron-job and added the log part.

0 0 30 * * /opt/bitnami/letsencrypt/scripts/renew-certificate.sh 2> /tmp/certificate-renewal.log

When we manually run the script without sudo, the certificate renew worked well.

We will contact you again if the isse reappears.

Many Thanks,

Hi @domidetres,

Thanks for letting us know. Let us know if it worked or not once the cron job is triggered.

Regards,
Gonzalo

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.