Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Install LetsEncrypt on Amazon AMI or CentOS
# Install LetsEncrypt
mkdir /opt/letsencrypt
git clone /opt/letsencrypt
# Create config file for LetsEncrypt (Replace YOUR_EMAIL with... well...)
mkdir /etc/letsencrypt/
touch /etc/letsencrypt/config.ini
echo "rsa-key-size = 4096" >> /etc/letsencrypt/config.ini
echo "email = YOUR_EMAIL" >> /etc/letsencrypt/config.ini
# Run LetsEncrypt to get cert (Replace DOMAIN_NAME and WEBROOT appropriately)
# DOMAIN_NAME nuff said
# WEBROOT is the absolute path to the webroot of the domain
/opt/letsencrypt/letsencrypt-auto certonly --webroot \
-d www.DOMAIN_NAME \
--config /etc/letsencrypt/config.ini \
# Let's Encrypt
SSLEngine on
SSLCertificateFile "/etc/letsencrypt/live/www.DOMAIN_NAME/fullchain.pem"
SSLCertificateKeyFile "/etc/letsencrypt/live/www.DOMAIN_NAME/privkey.pem"
# Lets Encrypt renewals (Runs twice a day)
* 3,20 * * * /opt/letsencrypt/letsencrypt-auto renew --config /etc/letsencrypt/config.ini --agree-to && /sbin/service httpd condrestart
# This is how you can configure crontab for a LigthSail instance
# Lets Encrypt renewals (Runs twice a day)
* 3,20 * * * /opt/letsencrypt/letsencrypt-auto renew --config /etc/letsencrypt/config.ini --agree-tos && /opt/bitnami/ restart apache
# If you are getting: `ImportError: No module named cryptography.hazmat.bindings.openssl.binding`
# Then run:
rm -Rf /opt/
# Also append `--debug` for the initial cert request.
/opt/letsencrypt/letsencrypt-auto certonly --webroot \
-d www.DOMAIN_NAME \
--config /etc/letsencrypt/config.ini \
--agree-tos \
# To fix the error:
# - The 'virtualenv==15.1.0' distribution was not found and is required by the application
# This should resolve any verison, not just 15.1.0
# Remove current virtualenv and use easy install to fix it
sudo rm -rd /usr/bin/virtualenv*
sudo /usr/bin/easy_install virtualenv
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.