【问题标题】:Lets Encrypt 403 - The client lacks sufficient authorization. Drupal 7 SiteLets Encrypt 403 - 客户端缺乏足够的授权。 Drupal 7 站点
【发布时间】:2016-04-18 10:04:24
【问题描述】:

当尝试生成 LetsEncript 证书时,我得到以下 403。

[ec2-user@myip html]$ /opt/letsencrypt/letsencrypt-auto certonly --webroot -w /var/www/html -d example.com -d www.example.com --config /etc/letsencrypt/config.ini --agree-tos 检查新版本... 请求 root 权限运行letsencrypt ... sudo /home/ec2-user/.local/share/letsencrypt/bin/letsencrypt certonly --webroot -w /var/www/html/myroot -d example.com -d www.example.com --config /etc/letsencrypt/config.ini --agree-tos 版本:1.1-20080819 版本:1.1-20080819 授权失败 程序。 mydomain.com (http-01): urn:acme:error:unauthorized :: The 客户端缺乏足够的授权 :: 来自无效的响应 http://example.com/.well-known/acme-challenge/IDug1d_rT8rZNPQQfdsgfdgsdfBKRJaHMTa3kulh4HnQ [52.30.98.10]:403

重要提示: - 服务器报错如下:

域:mydomain.com 类型:未经授权的详细信息:无效 来自http://example.com/.well-known/acme-的回复
挑战/IDug1d_rT8rZNPQQkjsdgfdgdfggdfajhsTa3kulh4HnQ
[52.30.98.101]:403

要修复这些错误,请确保您的域名是
正确输入和该域的 DNS A 记录
包含正确的 IP 地址。

【问题讨论】:

    标签: apache .htaccess drupal amazon-ec2 lets-encrypt


    【解决方案1】:

    如何在 Drupal 上配置 Let's Encrypt

    要使您的 Drupal 站点与 Let's Encrypt 一起使用,以下是 htaccess 文件中所需的更改。

    这一行:

    <FilesMatch "\.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\..*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock))$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$">
    

    由这一行交换:

    <FilesMatch "\.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock))$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$">
    

    还有,这一行:

    RewriteRule "(^|/)\." - [F]
    

    由这一行交换:

    RewriteRule "(^|/)\.(?!well-known)" - [F]
    

    来源: https://support.cloudways.com/configure-drupal-lets-encrypt/

    【讨论】:

      【解决方案2】:

      事实证明 Drupal 的 .htaccess 文件(确实如此)不允许访问隐藏文件。我暂时将 .htaccess 文件重命名为 .temphtaccess 并且授权工作。

      /opt/letsencrypt/letsencrypt-auto certonly --webroot -w /var/www/html/myroot -d example.com -d www.example.com --config /etc/letsencrypt/config.ini --同意 正在检查新版本... 请求 root 权限以运行letsencrypt... sudo /home/ec2-user/.local/share/letsencrypt/bin/letsencrypt certonly --webroot -w /var/www/html/myroot -d example.com -d www.example.com --config /etc/ Letencrypt/config.ini --agree-tos 版本:1.1-20080819 版本:1.1-20080819

      重要提示: - 恭喜!您的证书和链已保存在 /etc/letsencrypt/live/example.com/fullchain.pem。您的证书将 于 2016-07-17 到期。获取新版本的证书 未来,只需再次运行 Let's Encrypt。 - 如果您喜欢 Let's Encrypt,请考虑通过以下方式支持我们的工作:

      捐赠给 ISRG / Let's Encrypt:https://letsencrypt.org/donate 捐赠给 EFF:https://eff.org/donate-le

      【讨论】:

        猜你喜欢
        • 2017-06-30
        • 2019-06-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-01-27
        相关资源
        最近更新 更多