【问题标题】:Certbot: No valid ip addresses found / Invalid response found (From Google Cloud)Certbot:未找到有效 IP 地址/找到无效响应(来自 Google Cloud)
【发布时间】:2019-12-29 18:11:11
【问题描述】:

我得到了这个 cmd:

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 的域,并且我使用谷歌云 DNS。

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

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

编辑:

我的 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:

【问题讨论】:

  • Certbot 在您的 Web 服务器根路径的 /.well-known/acme-challenge/ 目录中创建一个特殊文件。错误消息说找不到此文件。使用您的操作系统、Web 服务器软件版本和配置文件的详细信息编辑您的问题。您正在运行的命令适用于 Apache Web 服务器。假设你有正确的 DNS 设置(你能正常访问你的网站吗?),那么你有一个 Certbot 不理解的 Web 服务器配置。
  • /.well-known/acme-challenge/ 我创建了 finder 并创建了一个名为 1234 的空文件,但仍然没有变化
  • 您为什么认为创建文件 1234 会起作用?这不是 Certbot 的运作方式。您的网站是否可以正常访问?什么版本的阿帕奇?请提供所需的详细信息。
  • 为您的 DNS 服务器添加设置。其中一个错误是No valid IP addresses found for pushupteam.dev
  • 服务器版本:Apache/2.4.29 (Ubuntu) 服务器构建时间:2019-09-16T12:58:48

标签: google-cloud-platform certbot google-cloud-dns


【解决方案1】:

我在尝试为在 DigitalOcean 液滴中运行的应用程序设置 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 记录,指向您遇到问题的域名的服务器公共/浮动/弹性/静态 IP 地址。 p>

假设您要获得example.comwww.example.com 的证书,请确保它们有一个A记录指向您服务器的public/浮动/弹性/静态IP地址

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

sudo certbot --nginx -d example.com

一旦成功,请使用您要用于扩展/修改它的所有域再次运行它:

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

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

就是这样。

我希望这会有所帮助

【讨论】:

    【解决方案2】:

    为了运行这个命令:

    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 都响应正常的网络浏览器请求。

    【讨论】:

      【解决方案3】:

      在你的 Apache 配置文件中添加一行 ServerName;

      ServerAlias *.pushupteam.dev
      

      然后再试一次。

      如果这不起作用,请更改“A”类型记录 - 从 www.pushupteam.dev 更改为 pushupteam.dev

      【讨论】:

        【解决方案4】:

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

        sudo systemctl reload nginx
        

        然后重新执行命令

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

        然后瞧。

        【讨论】:

          猜你喜欢
          • 2017-08-10
          • 1970-01-01
          • 2017-03-03
          • 2014-08-15
          • 2021-12-13
          • 1970-01-01
          • 2016-12-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多