您的位置:首页 > 理论基础 > 计算机网络

使用Let's encrypt保护你的网络通信

2017-03-23 10:24 218 查看
原始设置

webroot:
/home/wwwroot/baidu.com/

origin config:
ssl_certificate /home/ssl/www.baidu.com.crt;
ssl_certificate_key /home/ssl/www.baidu.com_nopass.key;


Shell:

wget https://dl.eff.org/certbot-auto chmod a+x certbot-auto
./certbot-auto certonly --webroot -w /home/wwwroot/baidu.com/ -d baidu.com -d www.baidu.com
ls /etc/letsencrypt/live/baidu.com/
|-cert.pem
|-chain.pem
|-fullchain.pem
|-privkey.pem

vi /usr/local/nginx/conf/nginx.conf

ssl_certificate /etc/letsencrypt/live/baidu.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/baidu.com/privkey.pem;

/usr/local/nginx/sbin/nginx -s reload

crontab -e
0 3 * * * /root/letsencrypt/certbot-auto renew >> /var/log/letsencrypt-renew.log
5 3 * * * /usr/local/nginx/sbin/nginx -s reload


很多东西写的不规范,仅供参考。

PS: ssl_certificate 使用cert.pem和fullchain.pem都可以使用,没发现有啥区别,谁了解请知会一声。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: