Skip to content

Instantly share code, notes, and snippets.

@4ley
Last active July 22, 2016 13:48
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 4ley/932142a26fc4a973099f to your computer and use it in GitHub Desktop.
Save 4ley/932142a26fc4a973099f to your computer and use it in GitHub Desktop.
Let's Encrypt Install Steps
# apt-get update && apt-get -y install git
# cd /usr/local/src/ && git clone https://github.com/letsencrypt/letsencrypt && cd letsencrypt/
# mkdir -p /usr/local/etc/letsencrypt/ && cp examples/cli.ini /usr/local/etc/letsencrypt/cli.ini
# nano /usr/local/etc/letsencrypt/cli.ini
# ./letsencrypt-auto certonly --config /usr/local/etc/letsencrypt/cli.ini
<VirtualHost *:80>
ServerName ...
Redirect permanent / https://.../
</VirtualHost>
<VirtualHost *:443>
...
SSLEngine on
# http://letsencrypt.readthedocs.org/en/latest/using.html#where-are-my-certificates
# Apache < 2.4.8
SSLCertificateFile /etc/letsencrypt/live/$server_name/cert.pem # replace $server_name with your host
# Apache >= 2.4.8
SSLCertificateFile /etc/letsencrypt/live/$server_name/fullchain.pem # replace $server_name with your host
SSLCertificateKeyFile /etc/letsencrypt/live/$server_name/privkey.pem # replace $server_name with your host
SSLCertificateChainFile /etc/letsencrypt/live/$server_name/chain.pem # replace $server_name with your host
...
</VirtualHost>
# install: /usr/local/src/letsencrypt/letsencrypt-auto certonly --config /usr/local/etc/letsencrypt/cli.ini
0 3 * * 0 /usr/local/src/letsencrypt/letsencrypt-auto renew --non-interactive && /usr/sbin/service nginx reload
server {
...
ssl on;
ssl_certificate /etc/letsencrypt/live/$server_name/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/$server_name/privkey.pem;
...
# letsencrypt acme challenge
location ~ /.well-known {
allow all;
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment