Apply cert for domain
this article is apply cert for domain on ubuntu 22.04
Install nginx
Install snap
1 2 3 4
| sudo snap install core sudo snap refresh core
sudo apt-get remove certbot
|
Install certbot
1 2 3 4 5 6 7 8 9
| sudo snap install --classic certbot sudo ln -s /snap/bin/certbot /usr/bin/certbot sudo snap set certbot trust-plugin-with-root=ok
sudo snap install certbot-dns-aliyun sudo snap set certbot trust-plugin-with-root=ok sudo snap connect certbot:plugin certbot-dns-aliyun /snap/bin/certbot plugins
|
Set up DNS credentials of aliyun
Go to https://ram.console.aliyun.com Apply AliYun child account And Set AliyunDNSFullAccess permission。Then create AccessKey for child account。
create certbot-dns-aliyun config:
1 2 3 4 5 6
| cat > /home/ubuntu/aliyun.ini <<EOF dns_aliyun_access_key = 12345678 dns_aliyun_access_key_secret = 1234567890abcdef1234567890abcdef EOF
chmod 600 /home/ubuntu/aliyun.ini
|
Apply cert for nginx
1 2 3 4
| sudo certbot -i nginx -a dns-aliyun --certbot-dns-aliyun:dns-aliyun-credentials /home/ubuntu/aliyun.ini -d xyfy.loan -d "*.xyfy.loan"
|