Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Letsencrypt with webroot on Apache

Config Apache with /etc/apache2/conf-available/le.conf:

Alias /.well-known/acme-challenge/ "/var/www/html/.well-known/acme-challenge/"
<Directory "/var/www/html/">
    AllowOverride None
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    Require method GET POST OPTIONS

Enable config:

sudo a2enconf le

Install cert / renew cert:

certbot-auto certonly --non-interactive --register-unsafely-without-email --agree-tos --expand --webroot --webroot-path /var/www/html --domain
certbot-auto renew --webroot --webroot-path /var/www/html --no-self-upgrade
Copy link

ambarusa commented Jul 18, 2022

I put that in a VHost, seems to work. Thank you!

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