Skip to content

Instantly share code, notes, and snippets.

@vzool
Last active November 30, 2016 18:17
Show Gist options
  • Select an option

  • Save vzool/1734ce81651cd1045b9804d2c1c8e117 to your computer and use it in GitHub Desktop.

Select an option

Save vzool/1734ce81651cd1045b9804d2c1c8e117 to your computer and use it in GitHub Desktop.
Script to update and install Let's Encrypt Automatically using "certbot"
#!/bin/bash
certbot renew --standalone --pre-hook "systemctl stop httpd" --post-hook "systemctl start httpd"
# Cron job by command(crontab -e)
# -------------------------
# 0 */12 * * * /root/renew-cert.sh > /dev/null 2>&1
# Apache option
# -------------------------
# SSLEngine on
# SSLCertificateFile /etc/letsencrypt/live/xxx.yyy/cert.pem
# SSLCertificateKeyFile /etc/letsencrypt/live/xxx.yyy/privkey.pem
# SSLCertificateChainFile /etc/letsencrypt/live/xxx.yyy/fullchain.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment