Vue normale
linux - Having all systemd timers mail to root on error - Super User
Renouvellement automatisé de certificats Letsencrypt avec certbot sur Debian
Je découvre que le cron /etc/cron.d/certbot
n'est en fait pas utilisé sur mon serveur Debian.
Dans ce fichier, il est précisé que c'est le timer certbot.timer
de systemd qui est utilisé (si on utilise systemd comme init, comme c'est le cas par défaut).
C'est donc pour cela que je ne recevais jamais de mail pour les renouvellements foirés de certificats Letsencrypt.
Oui, car par défaut, et contrairement au fonctionnement par défaut de cron, aucun mail n'est envoyé en cas d'erreur à l'exécution de la tâche planifiée. ¯_(ツ)_/¯
Voici une solution pour changer cela.
— Permalien
- @jeekajoo links
- ACME challenge catch-all for any (sub)domain in Apache - #7 by MikeMcQ - Help - Let's Encrypt Community Support
ACME challenge catch-all for any (sub)domain in Apache - #7 by MikeMcQ - Help - Let's Encrypt Community Support
After comparing some notes around the Internet I've came up with this "catch-all" for in Apache. So not just one vhost, anything will catch it. Keeping the configs clean and simple.
Put the following in the conf-enabled directory (Debian based systems):
Alias /.well-known/acme-challenge/ "/var/www/html/.well-known/acme-challenge/"
<Directory "/var/www/html/">
Options None
AllowOverride None
ForceType text/plain
RedirectMatch 404 "^(?!/\.well-known/acme-challenge/[\w-]{43}$)"
</Directory>
Enable it with a2enconf, reload the Apache service. Make sure the directory /var/www/html/.well-known/acme-challenge/ is created and owned by the Apache data user, e.g. www-data. It can be any directory, as long as you keep it consistent.
Then run this command:
certbot certonly --webroot --agree-tos --email youradmin@example.com --webroot-path /var/www/html/ --domain yoursite.example.com
— Permalien