使用 certbot 对网站免费加 https 协议

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用 certbot 对网站免费加 https 协议相关的知识,希望对你有一定的参考价值。

CentOS 系统 nginx 环境

cd /usr/local/src
wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto
./certbot-auto --nginx(自动)


出现以下内容表示成功:

IMPORTANT NOTES:

  • Congratulations! Your certificate and chain have been saved at:
    /etc/letsencrypt/live/c.pensukeji.com/fullchain.pem
    Your key file has been saved at:
    /etc/letsencrypt/live/c.pensukeji.com/privkey.pem
    Your cert will expire on 2018-10-16. To obtain a new or tweaked
    version of this certificate in the future, simply run certbot-auto
    again with the "certonly" option. To non-interactively renew all
    of your certificates, run "certbot-auto renew"
  • Your account credentials have been saved in your Certbot
    configuration directory at /etc/letsencrypt. You should make a
    secure backup of this folder now. This configuration directory will
    also contain certificates and private keys obtained by Certbot so
    making regular backups of this folder is ideal.
  • If you like Certbot, please consider supporting our work by:

    Donating to ISRG / Let‘s Encrypt: https://letsencrypt.org/donate
    Donating to EFF: https://eff.org/donate-le


./certbot-auto renew --dry-run(测试自动续订)
./certbot-auto renew(执行自动续订)
定时任务
为了做到自动化,我们要设置计划任务定时检查更新
编辑/etc/crontab增加一行规则
**12** root ./usr/local/src/certbot-auto renew
详细过程,手动过程及各个版本的安装方式可到以下官网自行查看
Certbot官网网址https://certbot.eff.org/

以上是关于使用 certbot 对网站免费加 https 协议的主要内容,如果未能解决你的问题,请参考以下文章

markdown Certbot在网站上启用https

如何使用 certbot 为没有域名的网站创建 SSL? [复制]

nginx使用certbot免费ssl证书,https很简单

Nginx 通过 certbot 为网站自动配置 SSL 证书并续期

Nginx 学习笔记个人网站的Https配置

Certbot给网站域名申请免费SSL证书 及Nginx配置