Certbot 软件包:从旧软件包切换到 20.04 版的 snap 软件包

Certbot 软件包:从旧软件包切换到 20.04 版的 snap 软件包

我有一台运行 Ubuntu 18.04 的服务器,其中安装了 certbothttp://ppa.launchpad.net/certbot/certbot/ubuntu,为 Apache 提供证书。我现在已经将服务器升级到 20.04,但 ppa repo 中没有针对 focal 的 certbot 版本。目前我已经更新到 disco 版本,但我认为我应该做的是用 snap 替换 ppa 版本。这是一个实时服务器,所以我不想搞砸这个过程。

我的问题是:如果我卸载旧的 certbot 包,然后安装新的 snap 版本,它会采用旧的配置并继续工作,还是我必须重新启动并重新配置 certbot?(如果是后者,当然,我需要安排一些停机时间,如果没有必要,我宁愿不这样做。)

感谢所有帮助,马丁

答案1

这很有效:

sudo apt remove certbot # to get rid of the old version. Config is retained undamaged.
sudo snap install --classic certbot # to install the now-preferred snap version
sudo certbot renew --dry-run # to check it was all working

答案2

总结:您可以毫无困难地切换到 certbot 的 snap 版本,并且停机时间最短。

我刚刚安装了 certbot 的 snap 版本,之前使用的是 ppa 版本的 certbot。虽然由于各种原因,我全新安装了 Ubuntu 20.04,但我备份了所有内容。我可以说 snap 版本和 ppa 版本的虚拟主机配置文件是相同的。就 Apache 所看到的而言,snap 版本和 ppa 版本之间没有区别。Certbot 仍然安装了 中的配置文件和证书/etc/letsencrypt/

例如,在我的虚拟主机文件的末尾,它提供:

Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem

您应该会看到非常相似的内容。

相关内容