我正在设置我的网站以通过 certbot 使用 https。
我正在按照这里的说明进行操作
我运行wget和chmod没有问题,但是当我执行时:
./certbot-auto
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
Setting up gyp (0.1+20150913git1f374df9-1ubuntu1) ...
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/version.py", line 24, in
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package gyp (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up python-virtualenv (15.0.1+ds-3) ...
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in
from …Run Code Online (Sandbox Code Playgroud) 亚马逊推出了一款名为“Amazon Linux 2”的新 Linux
当我尝试让 certbot 运行时......
wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto
./certbot-auto
Run Code Online (Sandbox Code Playgroud)
给出这个错误
Sorry, I don't know how to bootstrap Certbot on your operating system!
You will need to install OS dependencies, configure virtualenv, and run pip install manually.
Please see https://letsencrypt.readthedocs.org/en/latest/contributing.html#prerequisites for more info.
Run Code Online (Sandbox Code Playgroud)
然后我尝试:
yum install pip
yum install python-pip
pip install cryptography
pip install certbot
yum install python-urllib3
yum install augeas
/usr/bin/certbot
Run Code Online (Sandbox Code Playgroud)
我收到这条消息
Traceback (most recent call last):
File "/usr/bin/certbot", line 7, in <module>
from certbot.main …Run Code Online (Sandbox Code Playgroud) 我正在使用 certbot 为第三方 Web 应用程序生成 ssl 证书。因为我无法进入源代码或文件夹结构,所以我使用了 DNS 验证。更复杂的是,我的 DNS 提供商没有明确说明更改何时应用和传播。我必须开始这个过程,获取值,将它们发布到 DNS,等待很长时间,然后按 ENTER 完成验证。如果我等待的时间不够长,或者与服务器的终端会话终止,我必须重新开始——这会生成要放入 DNS 的新值。
我想查询我的 DNS 名称服务器以查看我的_acme_challenge值是否以及何时传播。Let's Encrypt 有一种方法可以检查这个值,但我似乎无法弄清楚这个。我找到的所有在线论坛都用于查询用于 SPF 的默认 TXT 记录。
certbot 验证过程的输出
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please deploy a DNS TXT record under the name
_acme-challenge.app.mydomain.com with …Run Code Online (Sandbox Code Playgroud) 我已经使用 certbot 的 --standalone 选项创建了一些证书,但我想更新它们所以我运行(测试是否会更新):
sudo certbot renew --dry-run
Run Code Online (Sandbox Code Playgroud)
但是对于某些域,我收到错误
Attempting to renew cert from /etc/letsencrypt/renewal/example.org.conf produced an unexpected error: Missing command line flag or config entry for this setting:
Select the webroot for example.org:
Choices: ['Enter a new webroot', '/var/www/ellakcy/']
(You can set this with the --webroot-path flag). Skipping.
Run Code Online (Sandbox Code Playgroud)
所以我希望在运行时sudo certbot renew能够自动更新我的证书,而无需提供 webroot 路径。
我怎么能做到这一点?
可能是一个愚蠢的问题,但是:更新 Let's encrypt 证书和获得新证书之间的区别在哪里?
此问题的相关问题和背景:我是否需要保留来自 certbot 的帐户数据?只要我可以验证我的域,我就会获得一个新证书。
我错过了什么?
我正在尝试通过命令在我的 Amazon ec2 RHEL nginx 服务器上设置让我们加密,$ sudo yum install certbot-nginx但它一直失败:
$ sudo yum install certbot-nginx
Last metadata expiration check: 2:58:11 ago on Sat 17 Aug 2019 11:29:45 PM UTC.
Error:
Problem: conflicting requests
- nothing provides pyparsing needed by python2-certbot-nginx-0.36.0-1.el7.noarch
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
Run Code Online (Sandbox Code Playgroud)
在网上做了一些绊脚石之后,我安装了各种 python 和 pip 包(完整列表如下)。知道我可能会错过什么吗?
这是我的操作系统详细信息,然后是安装的 python 和 pip 包...
$ cat /etc/os-release
NAME="Red Hat Enterprise Linux"
VERSION="8.0 (Ootpa)"
ID="rhel"
ID_LIKE="fedora" …Run Code Online (Sandbox Code Playgroud) 我有一台使用 certbot/letsencrypt 证书支持 HTTPS 的服务器。
我正在进行一般软件升级,以便最大限度地减少风险和停机时间,我在新服务器上安装新版本,并在其中导入实时服务器数据进行测试。当一切正常后,我将更改 DNS 记录以指向新服务器。
我的问题是我应该怎么办证书?我可以复制现有的并在必要时更新它吗?或者证书是否会不兼容和/或 LE 会抱怨地址在自动续订过程中已更改?LE 对反向 DNS 是否敏感(反向 DNS 工作可能需要更多延迟)。难道还有什么问题是我没有想到的吗?
我在 Node 中开发了一个 REST API,并在其前面安装了 nginx 作为反向代理,以便处理来自 Letsencrypt 的 SSL 证书。这是我第一次设置 nginx,但一切似乎都按预期工作。certbot 安装很顺利,证书已就位并且可以运行。我唯一担心的是我看不到任何自动续订的证据。
Certbot 文档说:
续订 certbot 的命令安装在以下位置之一:
/etc/crontab/
/etc/cron.*/*
systemctl list-timers
Run Code Online (Sandbox Code Playgroud)
我已经检查了上述所有位置,但在任何地方都没有 certbot 的痕迹。运行时sudo certbot renew --dry-run没有任何错误消息,但据我所知,没有创建 cron 作业或计时器。文档是否已经过时,或者问题是我缺乏 Linux 技能?
服务器运行 Ubuntu 20.04.1 LTS 和 nginx/1.18.0 (Ubuntu)。
我发现了很多类似的问题,人们询问如何在不同端口(80/443 除外)上设置 SSL,即1234端口。然而,所有答案都是类似use redirection或proxying requests或dns-validation (instead of http)或使用替代方法。然而,你在 StackExchange 中找不到任何一个答案 ,我的意思是对于新手来说一步一步,如何做到这一点。
但是,请注意,重定向不是解决方案,因为在 80/443 上,一个人可能有一个常规网站,但在 1234 端口上有一个完全不同的应用程序。那么,仅仅从1234到 的“重定向”80就会弄乱网站,对吗?
我希望有人能够满足我对 certbot 和 nginx 在续订期间如何交互的好奇心。
在我的 Linux 主机上,我设置了 certbot 和 certbot-nginx 插件。我在 /etc/nginx/conf.d 中设置了一些常规的 nginx 站点定义,并且在注册证书时,certbot-nginx 插件将 TLS 信息添加到我的各个站点的这些单独的 nginx conf 文件中。
要更新,我在 systemd 服务中每天触发一次以下内容:
/bin/certbot renew --non-interactive --agree-tos --no-self-upgrade --post-hook "systemctl reload nginx"
Run Code Online (Sandbox Code Playgroud)
使用journalctl查看systemd日志,我可以看到证书在适当的时候被更新。
它可以工作,但让我烦恼的是,我在配置中找不到任何告诉 nginx 让请求通过我的任何域的“.well-known/acme-challenge”的内容。它不在我的任何 nginx 配置文件中。我只是想知道 certbot 如何能够在该路径上提供令牌。我已经在文件系统中查找了“众所周知”和“acme-challenge”的块,但什么也没有出现。我的站点 nginx 配置文件中唯一的“root”指令指向它们各自的静态站点。除了 /usr/share/nginx/html 中的默认“It Works”站点之外什么都没有。
certbot 是否会启动自己的服务器?我很怀疑,因为我不认为它能够与 nginx 同时绑定到端口 80。
certbot ×10
lets-encrypt ×5
nginx ×3
amazon-linux ×1
cron ×1
pip ×1
python ×1
redhat ×1
ssl ×1
txt-record ×1
ubuntu ×1