Init
This commit is contained in:
48
03-UnrealEngine/流程管理与部署/VPS服务部署/ACME.sh 使用资料.md
Normal file
48
03-UnrealEngine/流程管理与部署/VPS服务部署/ACME.sh 使用资料.md
Normal file
@@ -0,0 +1,48 @@
|
||||
## 地址
|
||||
https://github.com/acmesh-official/acme.sh
|
||||
|
||||
## 通过acme.sh脚本来设置证书
|
||||
安装acme.sh
|
||||
```
|
||||
apt-get update && apt-get -y install socat //安装socat
|
||||
yum install socat
|
||||
wget -qO- get.acme.sh | bash //安装脚本
|
||||
source ~/.bashrc
|
||||
```
|
||||
|
||||
## 申请证书
|
||||
在你的域名解析服务提供商那里添加好解析记录,假定你的域名是yourdomain.com,记得不要开启CDN,然后执行下面命令申请证书。
|
||||
```
|
||||
acme.sh --issue --standalone -d yourdomain.com -k ec-256
|
||||
```
|
||||
因为本人要有blog,需要与nginx容器共存,所以使用网站目录方式:
|
||||
```
|
||||
acme.sh --issue -d blueroses.top -d www.blueroses.top -d tj.blueroses.top -k ec-256 --webroot /root/docker/nginx/html
|
||||
```
|
||||
|
||||
### 通配符证书申请
|
||||
通配符证书只支持dns方式,这里使用CloudFlare。首先在https://dash.cloudflare.com/profile/api-tokens 申请一个Global API Token。点击Global API Key栏的View即可,之后输入:
|
||||
```bash
|
||||
export CF_Key="19db67256c0eca16b5f4f4e8a7150c00eec16"
|
||||
export CF_Email="378100977@qq.com"
|
||||
```
|
||||
|
||||
```bash
|
||||
acme.sh --issue -d blueroses.top -d *.blueroses.top --dns dns_cf \
|
||||
--key-file /root/docker/trojan/trojan.key \
|
||||
--fullchain-file /root/docker/trojan/trojan.crt \
|
||||
--reloadcmd "docker restart nginx-web trojan"
|
||||
```
|
||||
|
||||
## 安装证书和私钥到指定位置
|
||||
```
|
||||
acme.sh --installcert -d blueroses.top \
|
||||
--fullchain-file /root/docker/trojan/trojan.crt \
|
||||
--key-file /root/docker/trojan/trojan.key \
|
||||
--ecc --reloadcmd "docker restart nginx-web trojan"
|
||||
```
|
||||
|
||||
## 自动续期
|
||||
```
|
||||
acme.sh --upgrade --auto-upgrade
|
||||
```
|
Reference in New Issue
Block a user