差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
it:server:security [2023-08-08 15:16] – [SSL 证书] goldentianyait:server:security [2025-12-30 14:55] (当前版本) – [ACME 证书] goldentianya
行 60: 行 60:
  
  
-====== ACME 证书 ====== 
  
-++++ 不再使用的方法 | 
-[[https://wsgzao.github.io/post/acme/|ACME 证书申请讲解]] 
  
-<code bash> 
-apt install -y socat 
-curl  https://get.acme.sh | sh 
-// ~/.acme.sh/  // 安装到自己目录下 
-</code> 
- 
-直接在Termial创建一个别名,可以方便使用 <color #ff7f27>''%%alias acme.sh=~/.acme.sh/acme.sh%%''</color> 
- 
-注册证书 
-<code bash> 
-~/.acme.sh/acme.sh --register-account -m [email protected] 
-// 开通 80 和 443 端口,否则无法监听  
-// 如果一直不通就加上参数 --server letsencrypt 
-~/.acme.sh/acme.sh  --issue -d simperator.top   --standalone 
-</code> 
- 
-安装完成后会自动更新证书,查看crontab 会发现这条命令\\ 
-<wrap lo>root@serverpi:~# crontab -l \\ 
-40 0 * * * "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" > /dev/null</wrap> 
- 
-拷贝证书到指定地点  
-<code bash> 
-~/.acme.sh/acme.sh --installcert -d simperator.top --key-file /root/ssl-keys/private.key --fullchain-file /root/ssl-keys/cert.crt 
- 
-</code>  
-   
-<wrap em>没有通配证书,simperator.top 和 ionos.simperator.top 要分别申请。</wrap> 
- 
-**为 nginx 配置证书** 
-以域名 ionos.simperator.top 为例 
- 
-1. 申请证书 <color #ff7f27>''%%acme.sh --issue  -d ionos.simperator.top   --nginx%%''</color> 
- 
-2. 创建文件夹 <color #ff7f27>''%%mkdir -p /etc/nginx/ssl/ionos.simperator.top%%''</color> 
- 
-3. 拷贝证书 
-<code bash> 
-~/.acme.sh/acme.sh --install-cert -d ionos.simperator.top \ 
---key-file        /etc/nginx/ssl/ionos.simperator.top/key.pem  \ 
---fullchain-file  /etc/nginx/ssl/ionos.simperator.top/cert.pem \ 
---reloadcmd     "service nginx force-reload" 
-</code> 
- 
-4 配置 conf 文件 
-<code> 
-ssl_certificate "/etc/nginx/ssl/ionos.simperator.top/cert.pem"; 
-ssl_certificate_key "/etc/nginx/ssl/ionos.simperator.top/key.pem"; 
-ssl_session_cache shared:SSL:1m; 
-ssl_session_timeout  10m; 
-ssl_ciphers HIGH:!aNULL:!MD5; 
-ssl_prefer_server_ciphers on; 
- 
-# Load configuration files for the default server block. 
-include /etc/nginx/default.d/*.conf; 
-</code> 
-++++ 
- 
-查看证书 <wrap em>acme.sh list</wrap> 有效日期, [[https://github.com/acmesh-official/acme.sh|acme.sh Github项目]] 
- 
-<WRAP center round important 60%> 
-cloudflare 现在已经不支持通过API设置.cf, .ga, .gq, .ml, 或.tk域名的DNS记录,在acme.sh设置TXT记录时会出错。只能单个证书申请。 
-</WRAP> 
- 
- 
-===== cloudflare ===== 
- 
-托管在 cloudflare 上的域名参考 [[https://blog.augustdoit.men/acme/|用 acme.sh 脚本申请 SSL 证书并自动更新]] 以及 [[https://www.zatp.com/post/auto-update-ssl-with-acme/|使用 acme.sh 自动签发和更新证书]] 
- 
-定时任务更新证书,并重新加载 nginx  
- 
-<code> 
-0 3 15 */2 * acme.sh --installcert -d simperator.com --fullchain-file /root/ssl-keys/fullchain.pem --key-file /root/ssl-keys/private.key --ecc && /etc/init.d/nginx reload 
-</code> 
- 
-自动更新 <color #ff7f27>''%%acme.sh --upgrade --auto-upgrade%%''</color> 
- 
-其实可以使用 cloudflare 的源服务器证书。需要开启 
-  - 完全加密 
-  - 始终使用 HTTPS  
-  - 打开小黄朵 
-  - 配置通配的边缘证书 
- 
-<WRAP center round tip 100%> 
-您的域/子域在 Cloudflare 的网络上未处于活动状态 
-Cloudflare 的 SSL 仅在您验证了根或 www DNS 记录的 SSL 证书后,才会向您网站的访问者显示,方法是在仪表板中将这些记录涂成橙色。如果 DNS 记录是灰色的,则 Cloudflare 颁发的 SSL 证书将不存在。 
-</WRAP> 
  
  
      
 {{tag>vps ubuntu acme}} {{tag>vps ubuntu acme}}
it/server/security.1691507814.txt.gz · 最后更改: 2023-08-08 15:16 由 goldentianya
回到顶部
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0