阿里云(域名解析) 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地址的项目就可以了。

相关推荐
艾莉丝努力练剑1 小时前
【AI大模型接入SDK】ChatGPT API
网络·c++·人工智能·websocket·网络协议·学习·chatgpt
4A广告文案8 小时前
名创优品在成都开了家“乐园”,顺便造了个新IP
网络·网络协议·tcp/ip
uoKent11 小时前
计网中的HTTP/HTTPS
网络协议·http·https
wjcroom13 小时前
一个可以在线多人玩的五子棋开发与布署方法-WebRTC和WebSocket的测试方法
websocket·网络协议·webrtc
AI备忘录18 小时前
(十九)华为华三锐捷迈普思科 交换机链路聚合配置命令(LACP/静态聚合五厂商对照)
运维·服务器·网络·网络协议·tcp/ip·华为
yonlingxu19 小时前
创客匠人深度陪跑案例:盘活存量 IP,解锁婚恋知识赛道第二增长曲线
网络·网络协议·tcp/ip
且白19 小时前
node、npm通过http-server架设本地服务器(可解决跨域)
服务器·网络协议·http
hiahiahia12319 小时前
HTTP Streaming:为什么 AI 回答经常要边生成边返回?
人工智能·网络协议·http
DLYSB_1 天前
旧上位机不肯改怎么办:原生 TCP 字节帧接入声光语音终端的改造实录
网络·网络协议·tcp/ip·报警灯
程序员夏洛1 天前
HTTP 2.0 和 3.0 有什么区别?
网络·网络协议·http