Author Topic: let encrypt ssl on centos7 and how to renew every 3 month.  (Read 5016 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
let encrypt ssl on centos7 and how to renew every 3 month.
« on: ตุลาคม 14, 2019, 06:35:23 PM »
==install letencrypt
yum install certbot python2-certbot-nginx
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload

===Obtaining a certificate for dev.packetlove.com
certbot --nginx -d dev.packetlove.com

===Renewing a certificate
certbot renew --dry-run
certbot renew
nginx -s reload


===vi /etc/cron.daily/letsencrypt-renew
#!/bin/sh
if certbot renew > /var/log/letsencrypt/renew.log 2>&1 ; then
   nginx -s reload
fi
exit

===chown
chmod +x /etc/cron.daily/letsencrypt-renew

===crontab -e
01 02,14 * * * /etc/cron.daily/letsencrypt-renew


===analyse ssl
https://www.ssllabs.com/ssltest/analyze.html?d=dev.packetlove.com