Skip to content

Instantly share code, notes, and snippets.

@trvswgnr
Last active February 12, 2021 00:27
Show Gist options
  • Select an option

  • Save trvswgnr/ea7a3caee5e09d39e975461c4d84b52d to your computer and use it in GitHub Desktop.

Select an option

Save trvswgnr/ea7a3caee5e09d39e975461c4d84b52d to your computer and use it in GitHub Desktop.
Automate Certificate Update on A Small Orange with Let’s Encrypt

Automate Certificate Update on A Small Orange with Let’s Encrypt

  1. Generate SSL cert and key if not already done: /home/yourusername/.acme.sh/acme.sh --issue -d yoursite.com -d www.yoursite.com -d mail.yoursite.com -w /home/yourusername/yoursitefolder. Note the .crt file and copy the path/filename for future use.

  2. Manually add SSL via A Small Orange cPanel, just this first time.

  3. Find corresponding .crt file in /home/yourusername/ssl/certs/ and copy path/filename. Do the same with .key file.

Add following to a cron job:

  1. Renew cert /home/yourusername/.acme.sh/acme.sh --renew -d yoursite.com -d www.yoursite.com -d mail.yoursite.com --force

  2. Copy file contents of Let's Encrypt .cer file to A Small Orange .crt file cat /home/yourusername/.acme.sh/yoursite.com/yoursite.com.cer > yoursite_com_c7fa3_ddd19_1620859608_a307fe1e4b125b78bf336b0344e03369.crt

  3. Copy file contents of Let's Encrypt .key file to A Small Orange .key file cat /home/yourusername/.acme.sh/yoursite.com/yoursite.com.key > /home/yourusername/ssl/keys/dc6e6_e57d1_019677b07e98fdc03442e486b15b37f2.key

  4. Cry because you still have to go to cPanel and click Update Certificate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment