在frps服务器上重建gitea服务器。数据库连到centos1上的mysql。
This commit is contained in:
@@ -94,6 +94,8 @@ acme.sh --force --debug --issue --dns dns_ali -d nr.woyue.org -d *.nr.woyue.org
|
||||
--fullchain-file /srv/certbot/conf/live/nr.woyue.org/fullchain.pem \
|
||||
--reloadcmd "docker restart nginx_server"
|
||||
|
||||
【2021/10/12】前期就已经重新更新失败。经查,依旧是访问某网址时超时的问题。为此,保持windows服务器的小飞机开启再强制重新更新成功。因此,先持续保留,以观察是否能续签成功。
|
||||
|
||||
(2)frps服务器上的acme更新与证书刷新
|
||||
|
||||
记录时间:2021/7/20
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<Import_RootNamespace>acme</Import_RootNamespace>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Include="$(MSBuildThisFileDirectory)实例研究1.md" />
|
||||
<None Include="$(MSBuildThisFileDirectory)README.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
117
acme/实例研究1.md
Normal file
117
acme/实例研究1.md
Normal file
@@ -0,0 +1,117 @@
|
||||
## 背景说明
|
||||
|
||||
a. 研究frps服务器的acme部署情况。
|
||||
|
||||
时隔久远,重新确认frps服务器的证书安装途径和现状。
|
||||
|
||||
b. 将gitea部署到现在frps的服务器上。
|
||||
|
||||
## 确认acme的状态
|
||||
|
||||
1. 确认当前证书
|
||||
|
||||
`acme.sh --list`
|
||||
|
||||
[root@ngork ~]# acme.sh --list
|
||||
Main_Domain KeyLength SAN_Domains CA Created Renew
|
||||
dev.woyue.org "" *.dev.woyue.org ZeroSSL.com Sat Sep 18 16:42:15 UTC 2021 Wed Nov 17 16:42:15 UTC 2021
|
||||
|
||||
2. 确认自动更新
|
||||
|
||||
`crontab -e`
|
||||
|
||||
o1 0 * * * "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" > /dev/null
|
||||
|
||||
3. 查找acme.sh文件
|
||||
|
||||
`find / -name acme.sh`
|
||||
|
||||
可以定位到当前服务器,这个文件位于:
|
||||
|
||||
/root/.acme.sh/acme.sh
|
||||
|
||||
这里要注意,ls是显示不出来.acme.sh的,可以直接cd .acme.sh
|
||||
|
||||
4. 查看.acme.sh目录下的内容
|
||||
|
||||
[root@ngork .acme.sh]# ls -l
|
||||
total 240
|
||||
-rw-r--r-- 1 root root 315 Sep 19 00:42 account.conf
|
||||
-rwxr-xr-x 1 root root 205958 Jul 20 11:50 acme.sh
|
||||
-rw-r--r-- 1 root root 78 May 17 2020 acme.sh.csh
|
||||
-rw-r--r-- 1 root root 78 May 17 2020 acme.sh.env
|
||||
drwxr-xr-x 4 root root 4096 Jul 20 11:50 ca
|
||||
drwxr-xr-x 2 root root 4096 Jul 20 11:50 deploy
|
||||
drwxr-xr-x 3 root root 4096 May 19 2020 dev.woyue.org
|
||||
drwxr-xr-x 2 root root 4096 Jul 20 11:50 dnsapi
|
||||
-rw-r--r-- 1 root root 252 Oct 27 00:41 http.header
|
||||
drwxr-xr-x 2 root root 4096 Jul 20 11:50 notify
|
||||
|
||||
其中,account.conf中有阿里云的具有DNS操作权限的账户的key和secret。
|
||||
|
||||
## 添加证书
|
||||
|
||||
1. 申请安装证书。加--debug参数可以显示更多细节
|
||||
|
||||
`acme.sh --debug --issue --dns dns_ali -d git.woyue.org`
|
||||
|
||||
2. 安装完毕后,检验是否配置自动任务
|
||||
|
||||
`crontab -e`
|
||||
|
||||
3. 确认当前证书
|
||||
|
||||
`acme.sh --list`
|
||||
|
||||
## 安装证书
|
||||
|
||||
1. 复制证书:
|
||||
|
||||
`mkdir -p /srv/certbot/conf/live/git.woyue.org`
|
||||
|
||||
`acme.sh --installcert -d git.woyue.org \
|
||||
--key-file /srv/certbot/conf/live/git.woyue.org/privkey.pem \
|
||||
--fullchain-file /srv/certbot/conf/live/git.woyue.org/fullchain.pem \
|
||||
--reloadcmd "docker restart nginx_nginx_1"`
|
||||
|
||||
注意,最后的nginx_nginx_1或nginx_server为nginx容器的名称。请根据实际情况修改。**或不加此参数,手动重启nginx**。
|
||||
|
||||
2. 生成:dhparams文件
|
||||
|
||||
`openssl dhparam -out /srv/certbot/conf/ssl-dhparams.pem 2048`
|
||||
|
||||
## 使用证书
|
||||
|
||||
例如,要使用上述证书,则nginx的docker对应etc/letsencrypt的目录就是/srv/certbot/conf。比如说,conf文件里引用的密钥文件路径为:
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/git.woyue.org/fullchain.pem
|
||||
|
||||
那么,docker mount的路径就应该是:-v /srv/certbot/conf:/etc/letsencrypt
|
||||
|
||||
为此,检查一下当前的nginx的volume:
|
||||
|
||||
`docker inspect nginx_nginx_1`
|
||||
|
||||
能看到:
|
||||
|
||||
......
|
||||
|
||||
"Mounts": [
|
||||
......
|
||||
{
|
||||
"Type": "bind",
|
||||
"Source": "/srv/certbot/conf",
|
||||
"Destination": "/etc/letsencrypt",
|
||||
"Mode": "rw",
|
||||
"RW": true,
|
||||
"Propagation": "rprivate"
|
||||
},
|
||||
|
||||
......
|
||||
|
||||
可见,当前的nginx docker实例配置已经满足要求。
|
||||
|
||||
## 后续
|
||||
|
||||
参看Gitea项目的Readme。
|
||||
|
||||
Reference in New Issue
Block a user