首页 > 服务器 > 换用Let’s Encrypt免费证书

作者:ghostry 发布时间:2017-05-16 浏览: 2975

转载注明出处: https://blog.ghostry.cn/server/776.html

原来在用的沃通证书失效了.
经过查询,发现了这个好东西

用起来也很简单,在要安装证书的服务器上操作,我的是Ubuntu

wget https://dl.eff.org/certbot-auto  
chmod a+x certbot-auto
./certbot-auto certonly -d abc.xyz -d cde.xyz

其中-d后边跟的是域名,可以跟多个,恩这个-d是可选的,也可以不写,我使用的是Apache插件模式.这个自动化工具如果不写域名会列出当前服务器已经在使用的域名.然后输入数字编号选择也行.
根据提示输入信息,完成后会提示文件路径.一般在/etc/letsencrypt/live/域名路径下.
然后写配置文件,可以使用工具https://mozilla.github.io/server-side-tls/ssl-config-generator/
很好用.关键部分我这里列一下.

SSLCertificateFile      /etc/letsencrypt/live/blog.ghostry.cn/cert.pem
SSLCertificateChainFile /etc/letsencrypt/live/blog.ghostry.cn/chain.pem
SSLCertificateKeyFile   /etc/letsencrypt/live/blog.ghostry.cn/privkey.pem

主要是文件对应关系要搞对.
这时候重启Apache一般就可以了.
客户端访问可能有延迟.多刷刷清缓存什么的.就能看到证书的安全标志了.
也可以用https://www.ssllabs.com/ssltest/index.html来检查
然后Let’s Encrypt证书有3个月有效期,要定时更新

crontab -e

加入以下内容

30 0 * * 6 /root/certbot-auto renew >> /root/certbot-renew.log

每周六零点30分更新证书,更新记录到文件.

标签: ubuntu apache 证书

上一篇: Otto开源机器人diy唱歌跳舞避障走路
下一篇: Ubuntu安装cura切片软件

添加新评论 »

*
*

欢迎评论!歡迎評論!Comments welcome!komentoj bonvenaj!댓글 오신 것을 환영합니다!
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: :cold: :cryy: :cute: :shy: :sleep: :struggle: :tea: :yahou: