Vous avez LAMP ou LEMP serveur sur votre machine mais vous souhaitiez utiliser un SSL gratuite est automatisé.
# voici les ligne de commande à suivre
sudo -i
apt update && apt-get upgrade -y
apt-get install software-properties-common && add-apt-repository universe
apt install curl openssl nginx certbot python3-certbot-nginx -y
systemctl enable cron
systemctl start cronsystemctl enable nginx
certbot --nginx -d dev.alexonbstudio.fr
# certbot --nginx -d dev.alexonbstudio.fr -d *.alexonbstudio.fr #multiple sous-domaincertbot renew --dry-run # Test renewal
certbot --nginx -d dev.alexonbstudio.fr #new install
certbot --nginx -d dev.alexonbstudio.fr --force-renewal --quiet #forcing renew
certbot renew --pre-hook "systemctl stop nginx" --post-hook "systemctl start nginx"
chown -R alexonbstudio:www-data /var/www/html
systemctl restart cron
systemctl restart nginx
openssl x509 -noout -dates -in /etc/letsencrypt/live/dev.alexonbstudio.fr/cert.pem #connaître la date & heure
crontab -e
=======================
@monthly rm /var/log/nginx/*.log
@monthly rm /var/log/letsencrypt/*.log
@weekly apt-get update && apt-get upgrade -y
@monthly apt update && apt upgrade -y
34 5 12 */2 * systemctl stop nginx && certbot renew -q && systemctl start nginx
* * * */6 * reboot
=======================
systemctl restart cron
systemctl restart nginx
# Remplacé alexonbstudio par votre pseudo (USER)
# Remplacé dev.alexonbstudio.fr par votre propre nom de domaine
# générateur de cron https://crontab-generator.org/
# pour la sécurité https://github.com/alexonbstudio/sysadmin
Reste plus à avoir A+ testé la sécurité SSL sur ssllabs.com
0 Commentaires