個(gè)人做的網(wǎng)站有什么危險(xiǎn)嗎培訓(xùn)學(xué)校招生營銷方案
文章目錄
- 1. 安裝 acme.sh
- 2. 添加云服務(wù)商安全訪問密鑰并授權(quán)管理DNS記錄
- 3. 當(dāng)前 Shell 添加安全訪問密鑰變量
- 4. 生成證書
- 5. 拷貝證書
- 6. 清理安全訪問密鑰變量
- 7. 打開腳本自動(dòng)更新
代碼倉庫地址:https://github.com/Neilpang/acme.sh
1. 安裝 acme.sh
yum -y install socat
curl https://get.acme.sh | sh
2. 添加云服務(wù)商安全訪問密鑰并授權(quán)管理DNS記錄
本次以 AWS 為例,授權(quán)策略配置如下:
{"Version": "2012-10-17","Statement": [{"Effect": "Allow","Action": ["route53:ListHostedZones"],"Resource": "*"},{"Effect": "Allow","Action": ["route53:GetHostedZone","route53:ListResourceRecordSets","route53:ChangeResourceRecordSets"],"Resource": "arn:aws:route53:::hostedzone/托管區(qū) ID"}]
}
3. 當(dāng)前 Shell 添加安全訪問密鑰變量
export AWS_ACCESS_KEY_ID=申請的AK
export AWS_SECRET_ACCESS_KEY=申請的SK
4. 生成證書
-d
參數(shù)可以是 *.songsong.me
泛域名或者 doc.songsong.me
單域名,亦支持多個(gè)域名串聯(lián)
acme.sh --register-account -m sre@songsong.me
acme.sh --issue --dns dns_aws -d songsong.me -d *.songsong.me
生成的證書和配置均保存于目錄:~/.acme.sh/
5. 拷貝證書
mkdir -p /App/nginx/conf/cert
acme.sh --install-cert -d songsong.me \
--key-file /App/nginx/conf/cert/server.key \
--fullchain-file /App/nginx/conf/cert/server.crt \
--reloadcmd "/root/scripts/nginx restart"
6. 清理安全訪問密鑰變量
unset AWS_ACCESS_KEY_ID
unset AWS_SECRET_ACCESS_KEY
7. 打開腳本自動(dòng)更新
acme.sh --upgrade --auto-upgrade