Apache 生成[www]证书后,[www]域出现Certbot/letsencrypt错误

Apache 生成[www]证书后,[www]域出现Certbot/letsencrypt错误,apache,ssl-certificate,ubuntu-18.04,lets-encrypt,certbot,Apache,Ssl Certificate,Ubuntu 18.04,Lets Encrypt,Certbot,我使用certbot设置了两个站点(下面的链接),并在生成HTTPS证书时输入了域的“www.”部分,导致两个站点的非www URL出现错误 在StackOverflow上有许多类似的问题,但到目前为止还没有一个解决我的问题 相关链接 工作域 无效域(因为缺少“www.”) 尝试修复命令 sudo certbot certonly--standalone-d fastsitephp.com-d www.fastsitephp.com sudo certbot delet

我使用certbot设置了两个站点(下面的链接),并在生成HTTPS证书时输入了域的“www.”部分,导致两个站点的非www URL出现错误

在StackOverflow上有许多类似的问题,但到目前为止还没有一个解决我的问题

相关链接

工作域

无效域(因为缺少“www.”)

尝试修复命令

  • sudo certbot certonly--standalone-d fastsitephp.com-d www.fastsitephp.com
  • sudo certbot delete--证书名称www.fastsitephp.com
Chrome将使用上述链接重新定向到“www”站点,但Firefox和Mobile Safari中的错误显而易见

服务器

  • Ubuntu 18.04 LTS与Apache
救命啊!我可以做些什么来修复这个问题,而不必安装新服务器和更改URL。理想情况下,服务器将同时支持www和非www;但是,如果无法修复,则可以接受Apache url重写


提前谢谢你

最后我自己解决了。主要问题是,即使在运行delete之后,Certbot仍然保留它创建的HTTP->HTTPS重定向和一些其他Apache配置设置(假设您在原始设置中选择了从HTTP重定向到HTTPS)

如果其他人有此问题,需要完全删除Certbot生成的证书,我使用以下命令:

sudo certbot delete
cd /etc/apache2/sites-enabled
ls
sudo nano 000-default.conf
    # Remove the redirect
sudo rm 000-default-le-ssl.conf
    # Also any file other SSL files such as [000-default-le-ssl.conf.sav]
sudo certbot --apache
    # enter both Domains "example.com www.example.com"
sudo service apache2 restart