|
@@ -8,7 +8,7 @@ apt update
|
|
apt install -y socat curl wget
|
|
apt install -y socat curl wget
|
|
|
|
|
|
# 安装acme.sh
|
|
# 安装acme.sh
|
|
-curl https://get.acme.sh | sh -s email=xiaoding@xiaodingyun.cn
|
|
|
|
|
|
+curl https://get.acme.sh | sh -s email=xiaoding@kbbei.com
|
|
|
|
|
|
# 重新加载环境变量
|
|
# 重新加载环境变量
|
|
source ~/.bashrc
|
|
source ~/.bashrc
|
|
@@ -21,12 +21,12 @@ source ~/.bashrc
|
|
rm -f /root/frp/cert.pem /root/frp/key.pem
|
|
rm -f /root/frp/cert.pem /root/frp/key.pem
|
|
|
|
|
|
# 移除acme.sh中的证书记录
|
|
# 移除acme.sh中的证书记录
|
|
-acme.sh --remove -d xiaodingyun.cn
|
|
|
|
-acme.sh --remove -d "*.xiaodingyun.cn "
|
|
|
|
|
|
+acme.sh --remove -d kbbei.com
|
|
|
|
+acme.sh --remove -d "*.kbbei.com "
|
|
|
|
|
|
# 清除acme.sh的域名配置
|
|
# 清除acme.sh的域名配置
|
|
-rm -rf ~/.acme.sh/xiaodingyun.cn
|
|
|
|
-rm -rf ~/.acme.sh/*.xiaodingyun.cn
|
|
|
|
|
|
+rm -rf ~/.acme.sh/kbbei.com
|
|
|
|
+rm -rf ~/.acme.sh/*.kbbei.com
|
|
```
|
|
```
|
|
|
|
|
|
## 3. 申请证书
|
|
## 3. 申请证书
|
|
@@ -35,23 +35,24 @@ rm -rf ~/.acme.sh/*.xiaodingyun.cn
|
|
|
|
|
|
```bash
|
|
```bash
|
|
# 设置腾讯云API密钥(需要先在腾讯云控制台获取SecretId和SecretKey)
|
|
# 设置腾讯云API密钥(需要先在腾讯云控制台获取SecretId和SecretKey)
|
|
-export DP_Id="9ec5c5a0a57611ef9fa21fb4ee2b819c"
|
|
|
|
-export DP_Key="84d361f9997546c5b16e821121a3337f"
|
|
|
|
|
|
+export DP_Id="bfa2b440b09d11ef8f4fdb396f4b4302"
|
|
|
|
+export DP_Key="81847f1a22e040e7b405708f51bf41d8"
|
|
|
|
+
|
|
# 设置腾讯云DNS API的标识符
|
|
# 设置腾讯云DNS API的标识符
|
|
https://console.cloud.tencent.com/taidc/api
|
|
https://console.cloud.tencent.com/taidc/api
|
|
-userId:673adf0c2ab3a41d61c2f385
|
|
|
|
-secretId:9ec5c5a0a57611ef9fa21fb4ee2b819c
|
|
|
|
-secretKey:84d361f9997546c5b16e821121a3337f
|
|
|
|
|
|
+secretId:bfa2b440b09d11ef8f4fdb396f4b4302
|
|
|
|
+secretKey:81847f1a22e040e7b405708f51bf41d8
|
|
|
|
+userId:674d952860db7708b27658ad
|
|
```
|
|
```
|
|
|
|
|
|
### 3.2 查看DNS解析记录
|
|
### 3.2 查看DNS解析记录
|
|
|
|
|
|
```bash
|
|
```bash
|
|
# 或者使用dig命令查询
|
|
# 或者使用dig命令查询
|
|
-dig TXT _acme-challenge.xiaodingyun.cn @8.8.8.8
|
|
|
|
|
|
+dig TXT _acme-challenge.kbbei.com @8.8.8.8
|
|
|
|
|
|
# 等待解析生效检查
|
|
# 等待解析生效检查
|
|
-nslookup -type=TXT _acme-challenge.xiaodingyun.cn
|
|
|
|
|
|
+nslookup -type=TXT _acme-challenge.kbbei.com
|
|
```
|
|
```
|
|
|
|
|
|
### 3.3 验证DNS记录
|
|
### 3.3 验证DNS记录
|
|
@@ -60,7 +61,7 @@ nslookup -type=TXT _acme-challenge.xiaodingyun.cn
|
|
|
|
|
|
```bash
|
|
```bash
|
|
# 验证DNS记录是否生效
|
|
# 验证DNS记录是否生效
|
|
-dig _acme-challenge.xiaodingyun.cn TXT
|
|
|
|
|
|
+dig _acme-challenge.kbbei.com TXT
|
|
|
|
|
|
# 等待DNS记录生效(通常需要等待1-5分钟)
|
|
# 等待DNS记录生效(通常需要等待1-5分钟)
|
|
```
|
|
```
|
|
@@ -82,7 +83,7 @@ sudo ip link set dev [网卡名] down
|
|
sudo ip link set dev [网卡名] up
|
|
sudo ip link set dev [网卡名] up
|
|
|
|
|
|
# 验证网络连接
|
|
# 验证网络连接
|
|
-ping -c 4 xiaodingyun.cn
|
|
|
|
|
|
+ping -c 4 kbbei.com
|
|
```
|
|
```
|
|
|
|
|
|
### 3.5 申请证书
|
|
### 3.5 申请证书
|
|
@@ -93,12 +94,12 @@ apt-get install idn
|
|
```bash
|
|
```bash
|
|
# 使用DNS方式验证域名所有权(腾讯云DNS)
|
|
# 使用DNS方式验证域名所有权(腾讯云DNS)
|
|
# 先清理已有证书
|
|
# 先清理已有证书
|
|
-acme.sh --remove -d xiaodingyun.cn
|
|
|
|
-acme.sh --remove -d "*.xiaodingyun.cn"
|
|
|
|
-rm -rf ~/.acme.sh/xiaodingyun.cn*
|
|
|
|
|
|
+acme.sh --remove -d kbbei.com
|
|
|
|
+acme.sh --remove -d "*.kbbei.com"
|
|
|
|
+rm -rf ~/.acme.sh/kbbei.com*
|
|
|
|
|
|
# 重新申请证书(添加debug参数)
|
|
# 重新申请证书(添加debug参数)
|
|
-acme.sh --issue --dns dns_dp -d xiaodingyun.cn -d "*.xiaodingyun.cn" --force
|
|
|
|
|
|
+acme.sh --issue --dns dns_dp -d kbbei.com -d "*.kbbei.com" --force
|
|
|
|
|
|
# 说明:
|
|
# 说明:
|
|
# dns_dp 是腾讯云DNS API的标识符
|
|
# dns_dp 是腾讯云DNS API的标识符
|
|
@@ -108,8 +109,8 @@ acme.sh --issue --dns dns_dp -d xiaodingyun.cn -d "*.xiaodingyun.cn" --force
|
|
|
|
|
|
### 3.6 根据提示操作
|
|
### 3.6 根据提示操作
|
|
|
|
|
|
-Adding TXT value: KXPGUraeHDzW0v4MuJ4pwmIbzo6RYz1uyI0E4Tou1bA for domain: _acme-challenge.xiaodingyun.cn
|
|
|
|
-
|
|
|
|
|
|
+Adding TXT value: KXPGUraeHDzW0v4MuJ4pwmIbzo6RYz1uyI0E4Tou1bA for domain: _acme-challenge.kbbei.com
|
|
|
|
+
|
|
|
|
|
|
## 4. 安装证书到frp指定目录
|
|
## 4. 安装证书到frp指定目录
|
|
|
|
|
|
@@ -118,7 +119,7 @@ Adding TXT value: KXPGUraeHDzW0v4MuJ4pwmIbzo6RYz1uyI0E4Tou1bA for domain: _acme-
|
|
mkdir -p /root/frp
|
|
mkdir -p /root/frp
|
|
|
|
|
|
# 安装证书到指定目录(PEM格式)
|
|
# 安装证书到指定目录(PEM格式)
|
|
-acme.sh --install-cert -d xiaodingyun.cn \
|
|
|
|
|
|
+acme.sh --install-cert -d kbbei.com \
|
|
--key-file /root/frp/key.pem \
|
|
--key-file /root/frp/key.pem \
|
|
--fullchain-file /root/frp/cert.pem \
|
|
--fullchain-file /root/frp/cert.pem \
|
|
--reloadcmd "systemctl restart frpc"
|
|
--reloadcmd "systemctl restart frpc"
|
|
@@ -145,7 +146,7 @@ crontab -l
|
|
|
|
|
|
## 注意事项
|
|
## 注意事项
|
|
|
|
|
|
-1. 已配置域名为:xiaodingyun.cn (包含泛域名 *.xiaodingyun.cn )
|
|
|
|
|
|
+1. 已配置域名为:kbbei.com (包含泛域名 *.kbbei.com )
|
|
2. 替换`your-secret-id`和`your-secret-key`为腾讯云API密钥(在腾讯云控制台 -> 访问密钥 -> API密钥管理中获取)
|
|
2. 替换`your-secret-id`和`your-secret-key`为腾讯云API密钥(在腾讯云控制台 -> 访问密钥 -> API密钥管理中获取)
|
|
3. 确保域名已正确解析到服务器IP
|
|
3. 确保域名已正确解析到服务器IP
|
|
4. DNS记录生效可能需要一些时间,如果证书申请失败,请等待几分钟后重试
|
|
4. DNS记录生效可能需要一些时间,如果证书申请失败,请等待几分钟后重试
|
|
@@ -162,4 +163,4 @@ acme.sh --log
|
|
ls -l /root/frp/cert.pem /root/frp/key.pem
|
|
ls -l /root/frp/cert.pem /root/frp/key.pem
|
|
|
|
|
|
# 检查DNS记录
|
|
# 检查DNS记录
|
|
-dig _acme-challenge.xiaodingyun.cn TXT
|
|
|
|
|
|
+dig _acme-challenge.kbbei.com TXT
|