I usually renew the certificate on our website training.unitsofsound.com by restarting apache services every 3 months but now this is not happening. Hence tried the below command
I ran this command: sudo certbot renew
It produced this output: Attempting to renew cert (training.unitsofsound.com) from /etc/letsencrypt/renewal/training.unitsofsound.com.conf produced an unexpected error: HTTPSConnectionPool(host='acme-v01.api.letsencrypt.org', port=443): Max retries exceeded with url: /directory (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f59a1ce0048>: Failed to establish a new connection: [Errno -2] Name or service not known',)). Skipping.
All renewal attempts failed. The following certs could not be renewed:
/etc/letsencrypt/live/training.unitsofsound.com/fullchain.pem (failure)
My web server is (include version): Server version: Apache/2.4.18 (Ubuntu)
Server built: 2018-04-18T14:53:04
The operating system my web server runs on is (include version):DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
My hosting provider, if applicable, is:
I can login to a root shell on my machine (yes or no, or I don't know): Yes
I'm using a control panel to manage my site (no, or provide the name and version of the control panel): no
The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): certbot 0.22.2
You have to update your client to use acme-v02. Given that you're using a very old certbot version and an even older ubuntu version... I don't know what to tell you. (your certbot version should support acme-v02)
It looks like the certificate has been renewed but not installed. You should check your apache config and see if it's looking in the right place, reload apache if needed.
I have resolved this now by copying the certificates from Lets Encrypt folder and then pasting it to the moodle certificate folder using the below command: