yum install certbot
#生成证书
certbot certonly --email icnych@gmail.com --agree-tos --webroot -w /var/www/blogs -d blog.qikqiak.com
#其中-w后面是网站根目录,-d后面是网站域名,所以需要保证目录存在并且可以正常访问。
#更新证书 Let's Encrypt证书的有效期只有90天
$ crontab -l
30 5 1 * * root /usr/bin/certbot renew --renew-hook "/usr/sbin/nginx -s reload"