二、https证书

certbot
阿里云脚本自动续期https

环境:ubantu18,阿里云ecs

安装certbot

sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx

使用阿里云dns工具创建通配符域名证书

测试需要加 --dry-run 测试命令(此处我使用python环境)
sudo certbot certonly -d *.wbget.com --manual --preferred-challenges dns --manual-auth-hook "/etc/nginx/cert/alidns/au.sh python aly add" --manual-cleanup-hook "/etc/nginx/cert/alidns/au.sh python aly clean"

证书文件地址
/etc/letsencrypt/live/wbget.com/fullchain.pem
/etc/letsencrypt/live/wbget.com/privkey.pem

查看证书

certbot certificates

续期

sudo certbot renew --manual --preferred-challenges dns --deploy-hook "nginx -s reload" --manual-auth-hook "/etc/nginx/cert/alidns/au.sh python aly add" --manual-cleanup-hook "/etc/nginx/cert/alidns/au.sh python aly clean"

你可能感兴趣的:(二、https证书)