3 March 2022
建议切换到root模式,可以减少证书安装时的问题
sudo su
注意:MacOS 不用切换到root更简单。
curl https://get.acme.sh | sh -s email=my@example.com
如果上面官方下载地址失败 或者 太慢,可以选用国内的备用地址
curl https://gitcode.net/cert/cn-acme.sh/-/raw/master/install.sh?inline=false | sh -s email=my@example.com
注意:安装完成后,再重新打开命令行(如果是 SSH,选择重新连接),以使acme.sh命令生效。
输入域名
获得域名验证(DCV)授权信息
到您的域名解析服务商添加解析记录,下面以DNSPod为例:
点击【配置完成,立即检测】后获得证书申请命令
部署到 WebServer
Apache example:
acme.sh --install-cert -d example.com \
--cert-file /path/to/certfile/in/apache/cert.pem \
--key-file /path/to/keyfile/in/apache/key.pem \
--fullchain-file /path/to/fullchain/certfile/apache/fullchain.pem \
--reloadcmd "service apache2 force-reload"
Nginx example:
acme.sh --install-cert -d example.com \
--key-file /path/to/keyfile/in/nginx/key.pem \
--fullchain-file /path/to/fullchain/nginx/cert.pem \
--reloadcmd "service nginx force-reload"
享受自动续期吧!
证书进入到30天有效期,acme.sh 会自动完成续期。服务状态
systemctl restart crond.service 重启crontab
本文转载自:https://blog.csdn.net/xs18952904/article/details/79262646
本文为wjw原创文章,转载无需和我联系,但请注明来自wjw博客http://wjiawen.cn
最新评论