适用于www和非www域的Letsencrypt证书 [英] Letsencrypt certificate for www and non-www domain

查看:106
本文介绍了适用于www和非www域的Letsencrypt证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经生成了SSL证书,如下所示:

I have generated SSL certificate like so:

sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
./letsencrypt-auto certonly --standalone

然后我被要求输入电子邮件...和一个域名.我输入了"mydomain.com"

Then I was asked for email ... and a domain name. I entered 'mydomain.com'

我发现我可以使用不同的方法输入要包含在一个证书中的多个域.例如:

I figured out that I could enter multiple domains to be included in one certificate using different approach. E.g.:

sudo -H ./letsencrypt-auto certonly --standalone -d example.com -d www.example.com

我想知道在对话框中被提升为我时是否可以输入多个域,或者现在是否需要使用其他方法重新生成?

I wonder if I could have entered multiple domains when I was promoted for them in a dialog or now I need to regenerate using a different approach?

在采用新方法之前,我是否需要删除以前的letencrypt安装?

Do I need to remove previous letsencrypt installation before going new way?

更新->已解决

sudo ./certbot-auto certonly --standalone -d mydomain.com -d www.mydomain.com

推荐答案

您不需要删除已安装的证书.

You do not need to remove the installed certificate.

如果您使用的是同一域,则可以将其扩展到您的子域.请执行以下操作:

You can extend it to your sub-domain if you're using the same domain. Do the following:

sudo certbot certonly --standalone -d domain.com -d www.domain.com

在提示您进行扩展或取消操作时,以E答复,然后按键盘上的Enter键.

When prompted for Expanding or Cancelling, reply with E then hit Enter key on your keyboard.

证书应已成功设置.

如果遇到此错误:问题绑定到端口80:无法绑定到IPv4或IPv6,通过运行systemctl stop apache2停止apache,然后再次运行上述certbot命令.

If you encounter this error: Problem binding to port 80: Could not bind to IPv4 or IPv6, stop apache by running systemctl stop apache2 then run the above certbot command again.

成功设置ssl证书后,请运行systemctl restart apache2来启动apache并再次运行.

Once the ssl certificate is successfuly setup, run systemctl restart apache2 to get apache up and running again.

这篇关于适用于www和非www域的Letsencrypt证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆