gpt4 book ai didi

ssl - 错误 turnkey linux confconsole dehydrated .well-known/acme-challenge 404 NOT FOUND

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

使用 RamNode 的 Turnkey Linux 发行版,我注意到我的网站有过期的证书,并且 https 链接被标记为“继续”对话框。进一步研究这个问题,Turnkey Linux 使用带有 Let's Encrypt 的 confconsole 来请求新证书。多个 [虚拟] 域要求用户手动使用 cronjob 每天在/etc/cron.daily/confconsole-dehydrated 下调用的 dehydrated-wrapper,但会导致错误:

/var/log/confconsole/letsencrypt.log

[2019-03-09 05:35:04] dehydrated-wrapper: FATAL: An unexpected service is listening on port 80: nginx:
[2019-03-09 05:35:04] dehydrated-wrapper: WARNING: Something went wrong, restoring original cert & key.
Restarting SSL tunnels: [stopped: /etc/stunnel/stunnel.conf] [Started: /etc/stunnel/stunnel.conf] stunnel.
[2019-03-09 05:35:09] dehydrated-wrapper: WARNING: Check today's previous log entries for details of error.
[2019-03-09 05:35:09] cron: ERROR: dehydrated-wrapper exited with a non-zero exit code.
[2019-03-10 05:35:04] cron: /etc/ssl/private/cert.pem has expired or will do so within 30 days. Attempting renewal.

解决方法:用

更新/usr/lib/confconsole/plugins.d/Lets_Encrypt/dehydrated-wrapper

替换:

netstat -ltpn | grep ":80 " | head -1 | cut -d/ -f2 | sed -e 's [[:space:]].*$||'

与:

netstat -ltpn | grep ":80 " | head -1 | cut -d/ -f2 \
| sed -e 's|[[:space:]].*$||; s|[^a-zA-Z0-9]||'

就像在这个提交中 https://github.com/turnkeylinux/confconsole/commit/d1e61c4767c2148663429d63bc3a42925af8cbcd

然后再次手动运行 cronjob 或等待明天:/etc/cron.daily/confconsole-脱水

[2019-03-31 19:26:45] confconsole.hook.sh: SUCCESS: Cert request successful. Writing cert.pem & cert.key for DOMAIN1 to /etc/ssl/private
[2019-03-31 19:26:52] confconsole.hook.sh: SUCCESS: Cert request successful. Writing cert.pem & cert.key for DOMAIN2 to /etc/ssl/private
[2019-03-31 19:26:59] confconsole.hook.sh: SUCCESS: Cert request successful. Writing cert.pem & cert.key for DOMAIN3 to /etc/ssl/private

谢谢你,我希望它能为你节省一些时间

相关链接:https://github.com/turnkeylinux/tracker/issues/976

最佳答案

我已经在问题贴中回答了这个问题,但是,这里再次为机器人提供答案。

解决方案:更新/usr/lib/confconsole/plugins.d/Lets_Encrypt/dehydrated-wrapper

替换:

netstat -ltpn | grep ":80 " | head -1 | cut -d/ -f2 | sed -e 's [[:space:]].*$||'

与:

netstat -ltpn | grep ":80 " | head -1 | cut -d/ -f2 \
| sed -e 's|[[:space:]].*$||; s|[^a-zA-Z0-9]||'

我可以通过讨论根本问题进一步扩展解决方案。

因为 dehydrated-wrapper 中的行已经将 WEBSERVER 变量分配给 nginx:,dehydrated 无法在请求和之前停止 nginx更新证书。将 nginx: 添加到 case 语句将允许您停止 nginx,但无法启动 nginx: 进程,因为它不存在,以托管 .well-known/acme-challenges 位置,当脱水尝试验证 https ssl 证书是否正确配置时导致 404。

关于ssl - 错误 turnkey linux confconsole dehydrated .well-known/acme-challenge 404 NOT FOUND,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55444824/

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