域名在80端口无法访问的情况下通过certbot生成证书

1、下载certbot-auto,请大家自行百度
2、通过修改dns记录的方式申请证书
sudo certbot-auto certonly --manual --preferred-challenge dns -d www.xxx.com(www.xxx.com替换成自己的域名)
执行完上述命令后,会告知你会记录你的IP,选择Y
信息如下:
NOTE: The IP of this machine will be publicly logged as having requested this
certificate. If you're running certbot in manual mode on a machine that is not
your server, please ensure you're okay with that.
Are you OK with your IP being logged?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y(这里选择Yes)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

3、接着会出现一个提示,要你把_acme-challenge.www.xxx.com(www.xxx.com替换成自己的域名)
设置成TXT记录,值也会写出来,设置好以后等待生效回车即可。

Please deploy a DNS TXT record under the name
_acme-challenge.www.xxx.com with the following value:
cDU9sWXtOvhjjTOIgCOd4ub3KgDm-Cv-lkB68YIXiUE
Before continuing, verify the record is deployed.

阿里云设置txt记录操作如下:

最后将生成的证书替换掉自己的证书就可

 

 

 
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值