Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Issue a LetsEncrypt SSL certificate using acme.sh
#!/bin/bash
# Issue a LetsEncrypt SSL certificate using acme.sh
#
# ISPConfig 3 preparation:
# Enable the SSL option and Add a self-signed certificate on SSL tab within Sites/Domains to create the needed configurations.
#
if [ -z "$*" ]; then
printf "\n issue-cert.sh domain.com \n\n"
exit 0
fi
acme="/usr/local/acme.sh/acme.sh"
webroot="/usr/local/ispconfig/interface/acme"
webssl="/var/www/${1}/ssl"
sslfilename="${1}"
#reloadcmd="service apache2 restart"
reloadcmd=""
issueargs="--issue -d ${1} -d webmail.${1} -d www.${1} -w ${webroot}"
installargs="--install-cert -d ${1} --cert-file ${webssl}/${sslfilename}.crt --key-file ${webssl}/${sslfilename}.key --fullchain-file ${webssl}/${sslfilename}.bundle --reloadcmd ${reloadcmd}"
echo ">${acme} ${issueargs}"
${acme} ${issueargs}
echo ">${acme} ${installargs}"
${acme} ${installargs}
@EthraZa

This comment has been minimized.

Copy link
Owner Author

EthraZa commented Oct 6, 2017

Install acme.sh:

git clone https://github.com/Neilpang/acme.sh.git
cd acme.sh
./acme.sh --install --home /usr/local/acme.sh --certhome /etc/acme.sh --accountemail "me@here.com.br"

Fix crontab:
54 0 * * * /usr/local/acme.sh/acme.sh --cron --home /usr/local/acme.sh > /dev/null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.