[英]How to change LetsEncrypt certbot domain?
I'm running my Django application on Digital Ocean with Ubuntu 16.04/Nginx/Gunicorn. 我正在使用Ubuntu 16.04 / Nginx / Gunicorn在Digital Ocean上运行Django应用程序。 I issued a (SSL?) certificate by running the following command:
我通过运行以下命令发布了(SSL?)证书:
sudo certbot --authenticator webroot --webroot-path /home/user/app --installer nginx -d aaa.com -d www.aaa.com
however I now want to change my domain from aaa.com
to bbb.com
. 但是我现在想将我的域名从
aaa.com
更改为bbb.com
。 How do I keep my certificate for my new domain? 如何为新域保留证书? When I ran the command to issue the certificate, I assume it created various files such as the directory
.well-known
- and also added code in my Nginx conf. 当我运行发出证书的命令时,我假设它创建了各种文件(例如
.well-known
目录),并且还在我的Nginx conf中添加了代码。 So do I simply run the same command again, with the new domain in? 那么,是否要在新域中再次简单地运行同一命令?
sudo certbot --authenticator webroot --webroot-path /home/user/app --installer nginx -d bbb.com -d www.bbb.com
or do I just change the current code and replace it with the new domain? 还是只更改当前代码并将其替换为新域? Eg my Nginx conf looks like this:
例如,我的Nginx conf看起来像这样:
ssl_certificate /etc/letsencrypt/live/aaa.com/fullchain.pem; #
managed by Ce$
ssl_certificate_key /etc/letsencrypt/live/aaa.com/privkey.pem; # managed by $
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
I've already changed: 我已经改变了:
server {
listen 80;
server_name 172.128.67.232 bbb.com www.bbb.com;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/user/app;
}
to my new domain bbb.com
. 到我的新域名
bbb.com
。
Advice appreciated. 意见表示赞赏。
You can not "move" a certificate that was issued for domain aaa.com
and use it for domain bbb.com
. 您不能“移动”为域
aaa.com
颁发的证书, aaa.com
其用于域bbb.com
。
Cleanest way to handle this would be to remove all references to the old aaa.com cert and the old https setup and then run the certbot ..
command to have domain bbb.com
set up. 解决此问题的最干净方法是删除对旧aaa.com证书和旧https设置的所有引用,然后运行
certbot ..
命令以设置域bbb.com
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.