UU Blog

用certbot生成Let's Encrypted证书并配置好nginx

1
2
3
4
5
6
yum -y install yum-utils
yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
yum install -y python2-certbot-nginx
pip install -U pip
pip install --upgrade --force-reinstall 'requests==2.6.0' urllib3
ln -s /usr/local/nginx/conf /etc/nginx

配置证书 certbot --nginx 根据提示生成证书

配置定时续约证书

crontab -e

1
0 0,12 * * * python -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew

好了没了,就这么简单

给作者打一针鸡血