gpt4 book ai didi

apache - 修复,让 Let's Encrypt 与 www 一起使用

转载 作者:行者123 更新时间:2023-12-04 18:54:53 25 4
gpt4 key购买 nike

Firefox does not trust this site since it uses a certifcate which is not valid for www.example.com. Certificate is only valid for example.com.

Error code: SSL_ERROR_BAD_CERT_DOMAIN


我在 Ubuntu 16、Apache httpd 上使用 Let's Encrypt。
如何添加它也适用于 万维网 ?我猜是Apache中的一些conf?
找不到任何关于它的东西。

最佳答案

假设你已经安装了certbot ( docs for your version of Ubuntu and Apache ),您应该使用 -d命令行开关以列出您希望证书适用的域。 From the docs :

 -d DOMAIN, --domains DOMAIN, --domain DOMAIN
Domain names to apply. For multiple domains you can
use multiple -d flags or enter a comma separated list
of domains as a parameter. The first domain provided
will be the subject CN of the certificate, and all
domains will be Subject Alternative Names on the
certificate. The first domain will also be used in
...

如果要进行空运行测试,请使用 certonly--dry-run (您必须以 rootsudo 的身份运行):
certbot certonly --dry-run -d www.example.com -d example.com
如果看起来一切正常,实际生成、安装和激活证书(注意这将重新启动 Apache):
certbot --apache -d www.example.com -d example.com
certbot将为您对 Apache 配置进行必要的编辑。
如果您希望手动进行编辑,请使用 webroot选项。 The docs for that option包括对多个域执行此操作的示例,包括 example.com 和 www.example.com .从该示例中删除其他域以简化这种情况:
certbot certonly --webroot -w /var/www/example -d www.example.com -d example.com
使用此选项时,您需要自己重新启动 Apache 才能使用新证书。

关于apache - 修复,让 Let's Encrypt 与 www 一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62664364/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com