阿里云(域名解析) certbot 证书配置

1、安装 certbot

ubuntu 系统:

复制代码
sudo apt install certbot

2、申请certbot 域名证书,如申请二级域名aa.example.com 的ssl证书,同时需要让 bb.aa.example.com 也可以使用此证书

1、命令:sudo certbot certonly -d "域名" -d "*.域名" --manual --preferred-challenges dns --server https://acme-v02.api.letsencrypt.org/directory

复制代码
sudo certbot certonly -d "aa.example.com" -d "*.aa.example.com" --manual --preferred-challenges dns --server https://acme-v02.api.letsencrypt.org/directory

2、执行命令后,一直 enter 直到,出现如下结果,此时需要登录阿里云配置域名解析。

复制代码
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Press Enter to Continue

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please deploy a DNS TXT record under the name:

_acme-challenge.aa.example.com.

with the following value:

n_5qYQgAiczCZmFbq7u

(This must be set up in addition to the previous challenges; do not remove,
replace, or undo the previous challenge tasks yet. Note that you might be
asked to create multiple distinct TXT records with the same name. This is
permitted by DNS standards.)

3、阿里云配置,需要等一下DNS 解析。

1、配置域名SSL解析

2、配置域名-IP解析(项目使用的域名)

图片如下:

4、回到:ubuntu,继续下一步,enter,成功如下:

复制代码
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/file.data-flop.com/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/file.data-flop.com/privkey.pem
This certificate expires on 2024-0*-0*.
These files will be updated when the certificate renews.

4、使用SSL证书:

1、上面图片已经为我们创建了一个 bb.aa.example.com 的指向192.168.0.1 的IP地址。

2、进入/etc/letsencrypt/live/file.data-flop.com/,拿到ssl证书文件,配置到192.168.0.1地址的项目就可以了。

相关推荐
会飞的鱼先生2 小时前
Node.js-http模块
网络协议·http·node.js
-qOVOp-6 小时前
408第三季part2 - 计算机网络 - ip分布首部格式与分片
网络协议·tcp/ip·计算机网络
数通Dinner6 小时前
RSTP 拓扑收敛机制
网络·网络协议·tcp/ip·算法·信息与通信
qq_1715388512 小时前
TCP/IP协议精解:IP协议——互联网世界的邮政编码系统
网络·网络协议·tcp/ip
兮动人13 小时前
获取终端外网IP地址
java·网络·网络协议·tcp/ip·获取终端外网ip地址
拾光拾趣录14 小时前
无状态协议下的用户状态管理:Web应用如何保持用户登录态
前端·http·https
海外空间恒创科技15 小时前
一台香港原生ip站群服务器多少钱?
服务器·网络协议·tcp/ip
DemonAvenger16 小时前
TCP连接池设计与实现:提升Go应用网络性能
网络协议·架构·go
游戏开发爱好者81 天前
iOS重构期调试实战:架构升级中的性能与数据保障策略
websocket·网络协议·tcp/ip·http·网络安全·https·udp
DemonAvenger1 天前
高性能 TCP 服务器的 Go 语言实现技巧:从原理到实践
网络协议·架构·go