Certbot:找不到有效的 IP 地址/找到无效的响应(来自 Google 云)

Certbot: No valid ip addresses found / Invalid response found (From Google Cloud)

我得到这个命令:

sudo certbot --apache -d pushupteam.dev -d www.pushupteam.dev

这是。我得到了什么:

Saving debug log to /var/log/letsencrypt/letsencrypt.log


 Plugins selected: Authenticator apache, Installer apache
    Obtaining a new certificate

Performing the following challenges:
http-01 challenge for pushupteam.dev
http-01 challenge for www.pushupteam.dev
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. www.pushupteam.dev (http-01): urn:ietf:params:acme:error:un
authorized :: The client lacks sufficient authorization :: Invalid response from http://www
.pushupteam.dev/.well-known/acme-challenge/j4gaJn6vX6tvEGu0HQagjT69Oc3R7l_VJ8CgaluAnLk [34.
89.161.114]: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>40
4 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p", pushupteam.dev (http-01): urn:
ietf:params:acme:error:dns :: No valid IP addresses found for pushupteam.dev
IMPORTANT NOTES:
 - The following errors were reported by the server:
   Domain: pushupteam.dev
   Type:   None
   Detail: No valid IP addresses found for pushupteam.dev
 - The following errors were reported by the server:
   Domain: www.pushupteam.dev
   Type:   unauthorized
   Detail: Invalid response from
   http://www.pushupteam.dev/.well-known/acme-challenge/j4gaJn6vX6tvEGu0HQagjT69Oc3R7l_VJ8C
galuAnLk
   [34.89.161.114]: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML
   2.0//EN\">\n<html><head>\n<title>404 Not
   Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p"
   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A/AAAA record(s) for that domain
   contain(s) the right IP address.

 

我有来自 Namecheap 的域,我使用 google 云 DNS。

问题是什么?我只对ipv4感兴趣,所以没有AAAA记录;

另外,我的 ufw 被禁用(像所有 google 虚拟机一样)

编辑:

我的etc/apache2/sites-available/srv.conf

<VirtualHost *:80>
 ServerAdmin admin@pushupteam.dev
 DocumentRoot /var/www/html/
 ServerName pushupteam.dev
 <Directory /var/www/html/>
Options +FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
 </Directory>
 ErrorLog /var/log/apache2/codeigniter-error_log
 CustomLog /var/log/apache2/codeigniter-access_log common
</VirtualHost>

我使用 Ubuntu 18.04 LTS 和 Apache

编辑 2:

pushupteam.dev. NS  3600    ns-cloud-b1.googledomains.com.
        ns-cloud-b2.googledomains.com.
        ns-cloud-b3.googledomains.com.
        ns-cloud-b4.googledomains.com.
pushupteam.dev. SOA 3600    ns-cloud-b1.googledomains.com.
 cloud-dns-hostmaster.google.com.
 1 21600 3600 259200 300
www.pushupteam.dev. A   60  34.89.161.114

我应该重新配置 DNS 吗?

编辑 3:

在您的 Apache 配置文件中的 ServerName 之后添加一行;

ServerAlias *.pushupteam.dev

然后重试。

如果这不起作用也更改 "A" 类型记录 - 从 www.pushupteam.devpushupteam.dev.

为了运行这个命令:

sudo certbot --apache -d pushupteam.dev -d www.pushupteam.dev

那么你需要在你的DNS服务器中添加一条DNS A资源记录:

pushupteam.dev A 3600 34.89.161.114

注意:请勿为 NS 记录设置短 TTL 值。通常这应该是一天(86,400 秒)。对于 A 记录,一小时(3600 秒)是正常的。您可以将这些值设置为任何值。考虑性能、缓存超时和成本。

对于 Apache 配置文件:/etc/apache2/sites-available/srv.conf 添加行:

ServerAlias www.pushupteam.dev

并重启 Apache 服务器:

sudo systemctl restart apache2

我假设您通过 运行 类似于 a2ensite srv 的命令正确启用了 srv.conf。通常配置文件名是主机名。

要仔细检查启用的虚拟主机,运行此命令:

apache2ctl -S

确保主机名 pushupteam.devwww.pushupteam.dev 都响应正常的网络浏览器请求。

我在尝试为 DigitalOcean Droplet 中的应用程序 运行ning 设置 SSL 时遇到此错误。

当我运行命令时:

sudo certbot --nginx -d example.com -d www.example.com

我收到错误:

No valid IP addresses found for www.example.com

During secondary validation: No valid IP addresses found for www.example.com

我是这样解决的:

确认您有一条 A 记录 指向您服务器的 public/floating/elastic/static IP 地址有问题。

假设您要为 example.comwww.example.com 获取证书,确保他们 两者 都有一个 A 记录 指向您服务器的 public/floating/elastic/static IP 地址.

如果您确认它们已正确设置并且您仍然遇到错误,请给它一个时间,比如 30 分钟到 1 小时,然后重试,或者更好的是 运行 证书生成对于符合条件的域,请说:

sudo certbot --nginx -d example.com

一旦成功,运行 再次使用您要使用的所有域 expand/modify 它:

sudo certbot --nginx -d example.com -d www.example.com

资源:No valid IP address found for domain when trying to get SSL certificate?

就这些了。

希望对您有所帮助

对我来说,在设置 A/AAAA 记录后,配置仍然失败,所以我先重新启动了 nginx:

sudo systemctl reload nginx

然后重新执行命令

sudo certbot --nginx -d example.com -d www.example.com

瞧瞧。