Installer un certificat Let’s Encrypt

BUT : Installer un certificat SSL let’s Encrypt sur un site web (Apache) sous ubuntu

Vous devez avoir configuré votre site web pour qu’il soit accessible sans certificat SSL, c’est à dire en mode http://nom_de_domaine.ext

Nous allons installer le magasin snap :

sudo snap install core
sudo snap refresh core

Suppression d’une ancienne version si besoin, puis installation de la dernière version de certbot :

Installation de certbot :

sudo snap install --classic certbot

Pour Installer un certificat de manière interactive sur tous les sites du serveur Apache :

Répondre aux différentes question :

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Enter email address (used for urgent renewal and security notices)
 (Enter 'c' to cancel): 

Donnez votre adresse e-mail, cette adresse sera utilisée pour les avertissements de sécurités ou les renouvellement de licence SSL

Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017-w-v1.3-notice.pdf.
You must agree in order to register with the ACME server. Do you agree?

Vous devez accepter les conditions d’utilisation en répondant : Y

Would you be willing, once your first certificate is successfully issued, to
share your email address with the Electronic Frontier Foundation, a founding
partner of the Let's Encrypt project and the non-profit organization that
develops Certbot? We'd like to send you email about our work encrypting the web,
EFF news, campaigns, and ways to support digital freedom.

Attention, ici on vous demande si vous acceptez de recevoir des informations de « Electronic Frontier Foundation » et de partager cette adresse avec leur partenaires. Répondre Y pour l’inscription aux news letters. Répondre N pour ne pas recevoir de mail d’information et publicitaire.

Account registered.

Which names would you like to activate HTTPS for?
We recommend selecting either all domains, or all domains in a VirtualHost/server block.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: nom_de_domaine.ext
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 

S’il y a plusieurs noms de domaine, sélectionnez ceux qui doivent obtenir un certificat SSL en donnant les numéros de domaine séparés par des espaces ou des virgule. Laisser vide si vous voulez sélectionner tous les domaines.

Requesting a certificate for nom_de_domaine.ext

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/nom_de_domaine.ext/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/nom_de_domaine.ext/privkey.pem
This certificate expires on 2022-12-08.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

Deploying certificate
Successfully deployed certificate for nom_de_domaine.ext to /etc/apache2/sites-available/nom_de_domaine.ext-le-ssl.conf
Congratulations! You have successfully enabled HTTPS on https://nom_de_domaine.ext

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:
 * Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
 * Donating to EFF:                    https://eff.org/donate-le
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Ou pour installer un certificat sur un seul site :

sudo certbot --apache -n -d nom_de_domaine.ext

Et voilà votre site est désormais accessible via https://nom_de_domaine.ext