certbot不会创建众所周知的文件夹(以及它如何知道在哪里这样做?)

问题描述 投票:0回答:1

我的服务器上有certbot。对于所有服务器,但对于由WSGI服务的Django应用程序,它都运行良好。

当我使用sudo certbot renew续订证书时,它说挑战尚未完成。我的webroot是/srv/site。 certbot以某种方式知道需要在static/.well-known/acme-challenge中提出挑战。 (我想知道它是怎么知道的,但这的确是正确的。)

如果我自己创建此文件夹,然后在其中放置文件“ hello”,则可以转到www.site.com/static/.well-known/acme-challenge/hello来撤消它。那么,为什么不能让加密访问它带来的挑战呢?

似乎没有创建此文件。即使以root身份运行并能够创建自己喜欢的任何文件夹,文件夹结构也不是。我正在使用watch -n 0.5 ls -a /srv/site/static查看是否创建了.well-known文件夹,但没有。

为什么?

完整错误:

user@host:/srv/site$ sudo certbot renew
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/domain.tld.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert is due for renewal, auto-renewing...
Plugins selected: Authenticator webroot, Installer None
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for site.domain.tld
Waiting for verification...
Cleaning up challenges
Attempting to renew cert (site.tld) from /etc/letsencrypt/renewal/domain.tld.conf produced an unexpected error: Failed authorization procedure. site.domain.tld (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from https://site.domain.tld/static/.well-known/acme-challenge/yD-WpiQsGL1E_fvs2m-U6UDuHdLCh6shuJkmUdIzhXs [139.162.191.205]: "<!doctype html>\n<html lang=\"en\">\n<head>\n<link href=\"https://fonts.googleapis.com/icon?family=Material+Icons\" rel=\"stylesheet\">\n<". Skipping.
All renewal attempts failed. The following certs could not be renewed:
  /etc/letsencrypt/live/domain.tld/fullchain.pem (failure)

我的服务器上有certbot。对于所有服务器,但对于由WSGI服务的Django应用程序,它都运行良好。当我使用sudo certbot更新续订证书时,它说挑战尚未完成。我的...

lets-encrypt certbot
1个回答
0
投票

您提到您将Webroot设置为/srv/site。因此,certbot将挑战放在/srv/site/.well-known/acme-challenge而不是/static/.well-known/acme-challenge/上。此外,在certbot命令完成后,certbot还会清除挑战,因此您将无法在其中找到挑战文件。我认为您需要将webroot更改为static

© www.soinside.com 2019 - 2024. All rights reserved.