本文将介绍使用Certbot为站点快速开启HTTPS
本文使用的环境为Ubuntu 16.04 server + Nginx
安装Certbot
在Ubuntu系统中,Certbot团队维护了一个PPA源,你可以将他添加到自己的仓库中。
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx
开启HTTPS!
在期间脚本会询问,哪些站点需要开启HTTPS,需不需要重定向,按需确认即可
sudo certbot --nginx
自动续约
因为Let's Encrypt证书只有90天,所以最好开启此功能。
sudo certbot renew --dry-run