添加acme,frps和nginx项目

This commit is contained in:
Dennis Mo
2020-05-19 22:44:58 +08:00
parent 71a107eeed
commit 4ddd5f14a2
15 changed files with 411 additions and 0 deletions

62
acme/README.md Normal file
View File

@@ -0,0 +1,62 @@
## 前期准备
主要是接下来安装acme时的gfw问题。如果是境内服务器则有可能需要如下步骤。
1. 小飞机的局域网内的代理地址。因为get.acme.sh中包含的脚本请求地址可能会被墙
`export http_proxy="172.18.184.139:10082"`
`export https_proxy="172.18.184.139:10082"`
2. 是因为据说在此加入上面的export命令可以实现开机自动开启代理。但没有尝试
`vim /etc/bashrc`
3. 同上
`vim /etc/profile`
## 安装acme
1. 安装acme
`curl https://get.acme.sh | sh`
2. 将dns api的key和secret存入环境变量。此处为阿里云事前已经给对应SAM子账户分配了FullDnsApiAccess的权限。参见 https://blog.csdn.net/chen249191508/article/details/98088553
`export Ali_Key="key"`
`export Ali_Secret="secret"`
参见保密区域获取真实内容。注意阿里云的控制台中这两个值只在添加SAM子账户的时候出现需要马上自行保存
## 获取证书
1. 申请安装证书。加--debug参数可以显示更多细节
`acme.sh --debug --issue --dns dns_ali -d dev.woyue.org -d *.dev.woyue.org`
2. 安装完毕后,检验是否配置自动任务
`crontab -e`
3. 确认当前证书
`acme.sh --list`
## 安装证书
1. 复制证书:
mkdir -p /srv/certbot/conf/live/dev.woyue.org
acme.sh --installcert -d dev.woyue.org -d *.dev.woyue.org \
--key-file /srv/certbot/conf/live/dev.woyue.org/privkey.pem \
--fullchain-file /srv/certbot/conf/live/dev.woyue.org/fullchain.pem \
--reloadcmd "docker restart nginxdocker_nginx_1"
注意最后的nginxdocker_nginx_1为nginx容器的名称。请根据实际情况修改。**或不加此参数手动重启nginx**。
2. 生成dhparams文件
openssl dhparam -out /srv/certbot/conf/ssl-dhparams.pem 2048