acme云服务器生成证书_使用ACME部署HTTPS

07573d98bd967425d80f93288f24ec18.png
acme.sh 是一个 ACME(自动化证书管理环境) 脚本,可以从 letsencrypt 生成免费的证书

安装

curl https://get.acme.sh | sh
~/.acme.sh/acme.sh --upgrade --auto-upgrade

配置DNS API

# 使用 DnsPod API 
export DP_Id=""
export DP_Key=""
# 使用 CloudXNS API 
# export CX_Key=""
# export CX_Secret=""

申请证书

nohup ~/.acme.sh/acme.sh 
        --issue --force 
        --dns dns_dp 
        -d gankcode.com 
        -d *.gankcode.com 
        -d example.com
        -d *.example.com 
        &

# --dns dns_dp 指定 使用 dnspod api
# -d 可以添加多个域名

tail -f nohup.out

# 成功后证书生成到 ~/.acme.sh/${第一个域名名称}/...

配置 Nginx

ssl_certificate      /root/.acme.sh/gankcode.com/fullchain.cer;
ssl_certificate_key  /root/.acme.sh/gankcode.com/kluster.cn.key;

有效期

证书有效期为3个月, 也就是说每三个月要申请一次并更新到服务器配置

官方文档

https://github.com/acmesh-official/acme.sh/wiki​github.com
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值