gpt4 book ai didi

apache - certbot-自动 : Client lacks sufficient authorization

转载 作者:太空宇宙 更新时间:2023-11-03 13:11:37 31 4
gpt4 key购买 nike

我知道这个问题已经被问过好几次了,但我需要一些具体的帮助,因为我一直在听取其他几个线程的建议,但到目前为止没有任何效果。

我正在尝试使用 certbot-auto renew 在 Ubuntu 14.04 中更新我的 SSL 证书,并且我正在运行 Apache2 服务器和 nginx。 certbot-auto renew 的输出如下:

  root@PostgreSQLServer:/# sudo certbot-auto renew
Saving debug log to /var/log/letsencrypt/letsencrypt.log

-------------------------------------------------------------------------------
Processing /etc/letsencrypt/renewal/my-domain.com.conf
-------------------------------------------------------------------------------
Cert is due for renewal, auto-renewing...
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for my-domain.com
Waiting for verification...
Cleaning up challenges
Attempting to renew cert from /etc/letsencrypt/renewal/my-domain.com.conf produced an unexpected error: Failed authorization procedure. my-domain.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://my-domain.com/.well-known/acme-challenge/ailNmgZADpb4QBipKM57sOi9w3PwNkwBwVFiRYs7i40: "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p". Skipping.

All renewal attempts failed. The following certs could not be renewed:
/etc/letsencrypt/live/my-domain.com/fullchain.pem (failure)
1 renew failure(s), 0 parse failure(s)

IMPORTANT NOTES:
- The following errors were reported by the server:

Domain: my-domain.com
Type: unauthorized
Detail: Invalid response from
http://my-domain.com/.well-known/acme-challenge/ailNmgZADpb4QBipKM57sOi9w3PwNkwBwVFiRYs7i40:
"<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p"

To fix these errors, please make sure that your domain name was
entered correctly and the DNS A record(s) for that domain
contain(s) the right IP address.

我确保 .well-known 文件夹存在于 /var/www/my-domain.com/public_html 并且当我导航到 http://my-domain.com/.well-known/ 在我的浏览器中,我能够看到该目录的内容。我还在 .well-known 中添加了一个 acme-challenge 文件夹,并包含了一个用于测试的 test.txt 文件;我能够在浏览器中访问目录和文本文件。

我发现当我运行 certbot-auto 命令时,acme-challenge 文件夹没有创建,所以这似乎是一个权限问题。我以 root 身份运行 certbot-auto,但也在 .well-known 上向 www-data 用户授予写入权限acme-challenge 文件夹(root 和 www-data 用户正在运行 apache2 和 nginx 进程)。

即使在授予该写入权限后,我仍然收到上面详述的 404 错误。

我还有一个通过 crontab 运行的自动证书更新过程,我将输出记录到本地文件中。在该日志文件中,我看到续订请求似乎正常工作,直到 certbot-auto 从 0.9.3 升级到 0.10.1。以下是升级发生时日志文件中的示例:

  -------------------------------------------------------------------------------
Processing /etc/letsencrypt/renewal/offensively-bad.com.conf
-------------------------------------------------------------------------------

The following certs are not due for renewal yet:
/etc/letsencrypt/live/offensively-bad.com/fullchain.pem (skipped)
No renewals were attempted.

-------------------------------------------------------------------------------
Processing /etc/letsencrypt/renewal/offensively-bad.com.conf
-------------------------------------------------------------------------------

The following certs are not due for renewal yet:
/etc/letsencrypt/live/offensively-bad.com/fullchain.pem (skipped)
No renewals were attempted.
Upgrading certbot-auto 0.9.3 to 0.10.1...
Replacing certbot-auto...
Creating virtual environment...
Installing Python packages...
Installation succeeded.

-------------------------------------------------------------------------------
Processing /etc/letsencrypt/renewal/offensively-bad.com.conf
-------------------------------------------------------------------------------

All renewal attempts failed. The following certs could not be renewed:
/etc/letsencrypt/live/offensively-bad.com/fullchain.pem (failure)
IMPORTANT NOTES:
- The following errors were reported by the server:

Domain: offensively-bad.com
Type: unauthorized
Detail: Invalid response from
http://offensively-bad.com/.well-known/acme-challenge/tkSc8l-r1XVPIF5TosTbEXiYMa8sQnoXEjAEgAwRoqI:
"<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p"

To fix these errors, please make sure that your domain name was
entered correctly and the DNS A record(s) for that domain
contain(s) the right IP address.

您可以看到升级后,进程开始失败并显示 404 消息。

我已经尝试了我可以在网上找到的所有建议,但完全被难住了,所以非常感谢任何帮助。提前致谢!

最佳答案

我的问题是我的树莓派 raspbian Stretch 上的 certbot 版本太旧:

certbot --version

certbot 0.10.2

apt-get install python-certbot-apache -t stretch-backports

成功了:

certbot 0.21.1

然后就

certbot --apache -d domain.com

希望这对您有所帮助!

关于apache - certbot-自动 : Client lacks sufficient authorization,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42194249/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com