使用 Let’s Encrypt 申请证书
Centos 7.9
安装 Let’s Encrypt
1 | yum install epel-release -y |
配置 Nginx 处理 ACME Challenge 请求
1 | 允许 Nginx 在 /var/www/letsencrypt 目录下查找 ACME Challenge 字符串文件。 |
运行 Let’s Encrypt 命令以获取证书
1 | certbot certonly --webroot -w /var/www/letsencrypt -d test.xxxxxx.com |
证书位置
1 | /etc/letsencrypt/live/test.sreproxy.com/fullchain.pem |
证书自动续签
1 | crontab -e |
转换 pem 证书(视情况转换)
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/test.sreproxy.com/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/test.sreproxy.com/privkey.pem Your certificate will expire on 2023-08-14. To obtain a new or tweaked version of this certificate in the future, simply run certbot again. To non-interactively renew all of your certificates, run “certbot renew”
- If you like Certbot, please consider supporting our work by:
- Donating to ISRG / Let’s Encrypt: https://letsencrypt.org/donate Donating to EFF: https://eff.org/donate-le
1 | 创建一个目录来存储您的 .crt 和 .key 文件 |