SSL证书申请及自动续期(acme.sh)

SSL证书申请及自动续期(acme.sh 三种部署方式)

官方文档:https://github.com/acmesh-official/acme.sh

一、安装

curl https://get.acme.sh | sh -s email=my@example.com
或者
wget -O -  https://get.acme.sh | sh -s email=my@example.com

二、申请证书及续期

· 方式一:通过云服务商AK/SK方式,比如阿里云
阿里云AK/SK申请链接: https://ram.console.aliyun.com/users
export Ali_Key="gkslhgdsndgijsambdkuhsaodngkjnsbdf"
export Ali_Secret="kopaeuigjshdjyfoansjghkajsybnikau"

#申请证书
./acme.sh --issue --dns dns_ali -d example.com -d www.example.com
· 方式二:通过dns修改TXT记录方式,一定要根据终端提示更改DNS的TXT记录值,再申请
# 通过dns申请证书
acme.sh --issue --dns -d example.com -d www.example.com --yes-I-know-dns-manual-mode-enough-go-ahead-please

# 按控制台输出变更域名对应的TXT值后执行下面命令
acme.sh  --renew -d example.com -d www.example.com  --yes-I-know-dns-manual-mode-enough-go-ahead-please
· 方式三:通过网站运行目录,直接部署,比如 宝塔的Nginx
acme.sh --issue -d example.com --webroot /www/wwwroot/example.com/
acme.sh  --install-cert -d example.com --key-file /www/server/panel/vhost/cert/example.com/privkey.pem --fullchain-file /www/server/panel/vhost/cert/example.com/fullchain.pem --reloadcmd "/etc/init.d/nginx reload"

三、自动续期

其实在安装acme.sh后系统会自己加一个定时任务,可以自己查看,也可以按需自己修改
1 0 * * * root /root/.acme.sh/acme.sh --cron --home /root/.acme.sh &>/var/log/acme.sh.logs
这样系统就会自动的续期证书了

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

想见感

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值