Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save akhiljalagam/4730eecc73a1e8017f1a39c9c3c03909 to your computer and use it in GitHub Desktop.
Save akhiljalagam/4730eecc73a1e8017f1a39c9c3c03909 to your computer and use it in GitHub Desktop.
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
</Directory>

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 my-domain.org
certbot-auto renew --webroot --webroot-path /var/www/html --no-self-upgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment