deb/apache-letsencrypt.bash
author Oleksandr Gavenko <gavenkoa@gmail.com>
Thu, 02 May 2024 15:46:52 +0300
changeset 33 7b602d7f98cd
parent 31 461eed8e7463
child 34 68975e7d5237
permissions -rw-r--r--
Added commend about alias.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28
47f47ba80e8d Let's Encrypt webroot renewal method.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     1
#!/bin/bash
47f47ba80e8d Let's Encrypt webroot renewal method.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     2
47f47ba80e8d Let's Encrypt webroot renewal method.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     3
mkdir /srv/www/letsencrypt
47f47ba80e8d Let's Encrypt webroot renewal method.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
47f47ba80e8d Let's Encrypt webroot renewal method.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
# service apache2 stop
47f47ba80e8d Let's Encrypt webroot renewal method.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
# --standalone
33
7b602d7f98cd Added commend about alias.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 31
diff changeset
     7
7b602d7f98cd Added commend about alias.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 31
diff changeset
     8
# Command requires Apache or Lighttpd running and aliasing (no need to stop Apache!):
7b602d7f98cd Added commend about alias.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 31
diff changeset
     9
#   Alias "/.well-known/acme-challenge/" "/srv/www/letsencrypt/.well-known/acme-challenge/"
29
74c62c0d1f64 apache user is no longer used on Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 28
diff changeset
    10
certbot certonly --webroot \
28
47f47ba80e8d Let's Encrypt webroot renewal method.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    11
 --agree-tos --non-interactive \
47f47ba80e8d Let's Encrypt webroot renewal method.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    12
 -m gavenkoa@gmail.com \
47f47ba80e8d Let's Encrypt webroot renewal method.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    13
 -w /srv/www/letsencrypt \
47f47ba80e8d Let's Encrypt webroot renewal method.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    14
 --cert-name defun.work \
31
461eed8e7463 Activating Let's Encrypt webroot renewal for all my sites.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 29
diff changeset
    15
 -d defun.work \
461eed8e7463 Activating Let's Encrypt webroot renewal for all my sites.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 29
diff changeset
    16
 -d 2048.defun.work \
461eed8e7463 Activating Let's Encrypt webroot renewal for all my sites.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 29
diff changeset
    17
 -d blog.defun.work \
461eed8e7463 Activating Let's Encrypt webroot renewal for all my sites.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 29
diff changeset
    18
 -d cooking.defun.work \
461eed8e7463 Activating Let's Encrypt webroot renewal for all my sites.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 29
diff changeset
    19
 -d gadict.defun.work \
461eed8e7463 Activating Let's Encrypt webroot renewal for all my sites.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 29
diff changeset
    20
 -d hg.defun.work \
461eed8e7463 Activating Let's Encrypt webroot renewal for all my sites.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 29
diff changeset
    21
 -d resume.defun.work \
461eed8e7463 Activating Let's Encrypt webroot renewal for all my sites.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 29
diff changeset
    22
 -d stat.defun.work \
461eed8e7463 Activating Let's Encrypt webroot renewal for all my sites.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 29
diff changeset
    23
 -d test.defun.work \
461eed8e7463 Activating Let's Encrypt webroot renewal for all my sites.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 29
diff changeset
    24
 -d tips.defun.work
461eed8e7463 Activating Let's Encrypt webroot renewal for all my sites.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 29
diff changeset
    25
28
47f47ba80e8d Let's Encrypt webroot renewal method.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    26
# service apache2 start
47f47ba80e8d Let's Encrypt webroot renewal method.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    27
47f47ba80e8d Let's Encrypt webroot renewal method.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    28
# https://wiki.debian.org/LetsEncrypt
47f47ba80e8d Let's Encrypt webroot renewal method.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    29
# python3-certbot-apache - Apache plugin for Certbot
47f47ba80e8d Let's Encrypt webroot renewal method.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    30
47f47ba80e8d Let's Encrypt webroot renewal method.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    31
# systemctl reload apache2
47f47ba80e8d Let's Encrypt webroot renewal method.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    32
# sudo certbot --apache --agree-tos --redirect -m youremail@email.com -d domainname.com -d www.domainname.com