Skip to content

Instantly share code, notes, and snippets.

@anhtuank7c
Last active August 11, 2016 07:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anhtuank7c/e624143562f9267b74b0b1bf4af4fba3 to your computer and use it in GitHub Desktop.
Save anhtuank7c/e624143562f9267b74b0b1bf4af4fba3 to your computer and use it in GitHub Desktop.
Install Let's Encrypt, create cert, automatic renew cert for Apache Ubuntu
(setup ssl self-cert first https://www.digitalocean.com/community/tutorials/how-to-create-a-ssl-certificate-on-apache-for-ubuntu-14-04)
1) Install the Server Dependencies:
apt-get update
apt-get install git
2) Download the Let’s Encrypt Client:
git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
3) Set Up the SSL Certificate:
./letsencrypt-auto --apache -d domain01.com -d www.domain01.com
./letsencrypt-auto --apache -d subdomain.domain01.com -d www.subdomain.domain01.com
etc....
4) Set Up Auto Renewal:
crontab -e
Include the following content, all in one line:
30 2 * * 1 /opt/letsencrypt/letsencrypt-auto renew >> /var/log/letsencrypt/letsencrypt-renew.log
10 2 * * 1 cd /opt/letsencrypt && git pull >> /var/log/letsencrypt/letsencrypt-update.log
5) Updating the Let’s Encrypt Client (optional):
cd /opt/letsencrypt
git pull
6) Check ssl cert
https://www.ssllabs.com/ssltest/analyze.html?d=your_domain
@anhtuank7c
Copy link
Author

Attention:
Before apply LetsEncrypt, you have to generate local ssl key then add to the ssl virtualhost
If test sefl-sign cert ok => then going to install letsencrypt.

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