【问题标题】:WordPress Address (URL) setting interferes with Let's Encrypt's challengeWordPress 地址 (URL) 设置干扰了 Let's Encrypt 的挑战
【发布时间】:2019-04-24 12:06:44
【问题描述】:

我的 WordPress 网站位于 apache2 服务器后面。实际站点位于/srv/www/<foldername> 下,因此我更改了 WordPress 网址设置:

  • WordPress 地址 (URL) : https://personaldomain.com/foldername
  • 网站地址(URL):https://personaldomain.com/

certbot 尝试解决挑战时,它会尝试访问https://personaldomain.com/.well-known/acme-challenge/hash,而实际文件位于https://personaldomain.com/foldername/.well-known/acme-challenge/hash 下。

有什么简单的方法可以解决这个问题?正如类似问题所建议的那样,我用.htaccess 尝试了许多不同的方法,但它对我不起作用。例如这些:

  1. RedirectMatch /.well-known/(.*)$ https://presonaldomain.com/foldername/.well-known/$1
  2. RewriteBase /
    RewriteRule ^(.*).well-known/(.*)$ $1<foldername>/.well-known/$2 [R=301, L]

不工作

【问题讨论】:

  • 首先,在Site Address和Wordpress Address url上设置url后,检查url在服务器上工作的正常索引html页面
  • 使用我在问题中提到的 WordPress 设置,网站在https://personaldomain.com 正常打开(期望行为)
  • 检查 personaldomain.com/index.html 这个网址 - 创建 index.html 并再次检查它是否工作
  • 如果我在文件夹/srv/www/<foldername>/index.html 中创建文件index.html,然后尝试打开personaldomain.com/index.html,它不起作用

标签: wordpress apache2 lets-encrypt


【解决方案1】:

事实证明,解决此问题的解决方法是编辑 /etc/letsencrypt/renewal/<mycertificate>.conf 并将挑战文件夹从 /srv/www/<foldername> 更改为 /srv/www

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-11-27
    • 2021-10-31
    • 1970-01-01
    • 2017-08-26
    • 2016-05-08
    • 1970-01-01
    • 2018-02-18
    • 1970-01-01
    相关资源
    最近更新 更多