无法选择合适的插件:nginx插件不起作用;

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

处理 /etc/letsencrypt/renewal/api.shunhinggaoke.com.conf

证书未到期续订,但正在模拟续订以进行试运行 无法选择合适的插件:nginx 插件不起作用;您现有的配置可能存在问题。 错误是:NoInstallationError() 尝试从 /etc/letsencrypt/renewal/api.shunhinggaoke.com.conf 续订证书 (api.shunhinggaoke.com) 时产生意外错误: nginx 插件无法正常工作;您现有的配置可能存在问题。 错误是:NoInstallationError()。跳绳。 所有续订尝试均失败。以下证书无法更新: /etc/letsencrypt/live/api.shunhinggaoke.com/fullchain.pem(失败)


** 试运行:在证书即将到期时模拟“certbot 续订” **(以下测试证书尚未保存。)

所有续订尝试均失败。以下证书无法更新: /etc/letsencrypt/live/api.shunhinggaoke.com/fullchain.pem(失败) ** 试运行:在证书即将到期时模拟“certbot 续订”

**(以上测试证书尚未保存。)

1 次更新失败,0 次解析失败

nginx certbot
2个回答
7
投票

首先检查 certbot-nginx 插件是否安装。

apt-get install python3-certbot-nginx 解决了我的 Debian 中的类似问题。


6
投票

我刚刚看到你的问题,不知道你是否还有这个问题。您需要发布更多详细信息。您甚至没有指出您在哪个平台上遇到了问题。我假设它在 Linux 机器上。如果是这样,您是从命令行还是从 cron 脚本运行

certbot renew --dry-run
命令?

上面的问题表明环境问题,很可能是 PATH 问题,我假设您只有在通过 cron 运行脚本时才会遇到此问题。我还假设您使用

crontab -e
sudo crontab -e
命令将其添加到 crontab 中。

通常提出的解决方案是在 crontab 文件本身中设置 PATH,然后重试。这意味着,不要执行

(sudo) crontab -e
,但请确保 /etc/crontab 文件中的系统 crontab 已设置它,或者在 certbot 的 crontab 文件中设置它。

对于 Ubuntu 16.04 上的我来说,它是 /etc/crond.d/certbot ,它看起来像这样:

#lots of commented lines preceding ...
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
0 */12 * * * root test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e'sleep int(rand(43200))' && certbot -q renew

每天运行两次。您可以通过添加另一行来测试它,如下所示:

* * * * * root /usr/bin/certbot renew --quiet --dry-run

然后查看您的 certbot 日志。它可能位于 /var/log/letsencrypt/letsencrypt.log 中并受到读保护。做一个

sudo tail -f  /var/log/letsencrypt/letsencrypt.log

看看你会得到什么。如果运行正常,您应该在运行结束时得到

no renewal failures
。该脚本每分钟运行一次,因此在获得日志后将其关闭。

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