Installing Certbot on AWS AMI

And here’s some notes on installing Certbot on an AWS AMI EC2:

I was having all kinds of issues with the certbot process, after having taken a snapshot and producing an image to duplicate an EC2, resulting in moving one of my services ( https://www.mailaddiction.com ) to its own instance.

The certbot process was complaining with strange errors that were never present on the original instance:

 

And after spending several hours of googling and trying several different potential fixes, this was the one that solved the problem:

As root:
$> rm -rf /opt/eff.org/*
$> /usr/local/bin/certbot-auto –debug
The above will produce errors, that’s okay, just continue:
$> cd /opt/eff.org/certbot/venv/lib64/python2.7
$> mv site-packages site-packages.sav
$> ln -s dist-packages/ site-packages
$> /usr/local/bin/certbot-auto –debug

Fixed!  Now I’m able to run “certbot-auto” to add a wildcard to a domain of mine:  

$> ./certbot-auto certonly –server https://acme-v02.api.letsencrypt.org/directory –manual –preferred-challenges dns -d *.mailaddiction.com

And we’re back in business.