ubuntu 安装Let’s Encrypt
1.使用Apache插件安装letsencrypt包
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-apache
2.申请证书并自动安装
# Apply a single domain
certbot --apache -d example.com
# Apply domain and it's sub-domain
certbot --apache -d example.com -d www.example.com
3.将自动续订添加到crontab以每月运行一次
Certificates issues by Let’s Encrypt are valid for 90 days and open to renew 30 days before expire.
Let’s run renew command every-day
crontab -e
, add the following line
0 0 * * * certbot renew
本文参考:
https://blog.tiger-workshop.com/lets-encrypt-for-apache-on-ubuntu-16-04/