Skip to content
本页内容

certbot 使用



1. 通过手动添加DNS解析验证 仅申请证书

执行后,需要按照命令输出内容 添加域名的txt解析

shell
certbot certonly --manual --preferred-challenges dns -d tools.zhaochn.cn

2. 通过HTTP-01 仅申请证书 ⭐️

按提示输入已配置好的80站点根目录地址,会自动生成验证文件到根目录,用于证书颁发API校验

shell
certbot certonly --preferred-challenges http-01 -d tools.zhaochn.cn 

3. 续签 (待验证命令可行性)

shell
certbot certonly renew --dry-run

4. 其他常用参数说明

txt
--force-renewal 此选项用于强制更新证书,即使当前证书尚未过期。
--config-dir 配置文件目录 (default: /etc/letsencrypt)
--work-dir 工作目录 (default: /var/lib/letsencrypt)
--logs-dir 日志目录 (default: /var/log/letsencrypt)