Avec Autorité de Certification gratuite Let’s Encrypte : http://letsencrypt.fr/
Update 01/05/2019
Le script de renouvellement de letsencrypt exige une version Python > 2.7.7 (ce que je lui ai donné : 2.7.12).
Mais pas prise en compte => La solution Certbot, relève le même sujet mais fait le travail =>
CryptographyDeprecationWarning: Support for your Python version is deprecated.
The next version of cryptography will remove support.
Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
En conclusion la tache Cron :
/root/letsencrypt/letsencrypt-auto --apache --renew-by-default --email vdft@vdft.fr --agree-tos -d www.vdft.fr -d vdft.fr
devient : /usr/local/bin/certbot-auto renew
Installation :
uniquement sous un terminal SSH (non émulé => Putty)
apt install -y git git clone https://github.com/letsencrypt/letsencrypt.git && cd letsencrypt/ /root/letsencrypt/letsencrypt-auto --apache --renew-by-default --email monmail@mondomaine.fr --agree-tos -d www.mondomaine.fr
renew permet aussi le renouvellement du certificat. Une tache Cron doit normalement tournée pour le faire périodiquement.
ou en manuel :
/root/letsencrypt/letsencrypt-auto certonly --webroot --webroot-path /var/www/html --renew-by-default --email example@example.org --agree-tos -d www.yourdomain.tld
Paramétrage :
- Sous SSH (Putty) :
- [Voir plus loin … ce paramétrage est incorrect]
Pour être valide il faut que la racine du site soit la MÊME que le nom du site complet => ici www.vdft.fr et PAS vdft.fr comme précédemment.
- /root/letsencrypt/letsencrypt-auto –apache –renew-by-default –email vdft@vdft.fr –agree-tos -d www.vdft.fr -d vdft.fr
Il y a aussi une autre solution avec Certbot :
https://certbot.eff.org/#debianjessie-apache
https://certbot.eff.org/docs/intro.html#how-to-run-the-client
Sous SSH :
./certbot-auto
./certbot–auto —apache –d vdft.fr –d www.vdft.fr
NE PAS OUBLIER :
Dans les fichiers de config du serveur apache (/etc/appache2/sites-available/???.conf)
de mettre en début de fichier :
NameVirtualHost www.MONSITE.COM:80 (ou 443 selon le virtuel host : Http=80 https=443)
Exemple :
NameVirtualHost www.toto.fr:443 <IfModule mod_ssl.c> <VirtualHost www.toto.fr:443> DocumentRoot /var/www/toto <Directory /var/www/toto> allow from all Options +Indexes </Directory> ServerName www.toto.fr Include /etc/letsencrypt/options-ssl-apache.conf ServerAlias toto.fr Include /etc/letsencrypt/options-ssl-apache.conf SSLCertificateFile /etc/letsencrypt/live/www.toto.fr/cert.pem SSLCertificateKeyFile /etc/letsencrypt/live/www.toto.fr/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf SSLCertificateChainFile /etc/letsencrypt/live/www.toto.fr/chain.pem </VirtualHost> </IfModule>