Linux Nginx网站:Certbot安装配置Lets Encrypt SSL免费HTTPS加密证书

原文地址:https://renwole.com/archives/157

实验环境:CentOS Linux release 7.2
内核版本:Linux version 3.10.0-514.26.2.el7.x86_64
Nginx版本: Nginx-1.13.0

Let’s Encrypt是一个免费的、自动化、开放的证书颁发机构。由Mozilla、Cisco、Chrome、facebook、Akamai等众多公司和机构发起的,其安全稳定及其可靠。具体信息可以去letsencrypt官方网站了解详情。

今天我们就充分利用Lets Encrypt让你的网站实现https加密。

官网:https://letsencrypt.org/

1.安装certbot及源扩展包

$ yum install -y epel-release

Certbot是Let’s Encrypt官方指定推荐的客户端。通过 Certbot,你可以自动化部署 Let’s Encrypt SSL证书,以便为网站加上HTTPS加密支持。

$ yum install certbot
$ certbot certonly
Saving debug log to /var/log/letsencrypt/letsencrypt.log
How would you like to authenticate with the ACME CA?
//你是希望如何使用ACME CA进行身份验证?
-------------------------------------------------------------------------------
1: Place files in webroot directory (webroot)
//将文件放在webroot目录
2: Spin up a temporary webserver (standalone)
//使用临时Web服务器(独立目录)
-------------------------------------------------------------------------------
Select the appropriate number [1-2] then [enter] (press 'c' to cancel):1 【选择1回车】
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel):su@renwole.com【输入您的邮箱地址,用于紧急更新和安全通知】 Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
-------------------------------------------------------------------------------
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.1.1-August-1-2016.pdf. You must agree
in order to register with the ACME server at
https://acme-v01.api.letsencrypt.org/directory
-------------------------------------------------------------------------------
(A)gree/(C)ancel: A【选择A回车同意服务条款,C为拒绝】
-------------------------------------------------------------------------------
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about EFF and
our work to encrypt the web, protect its users and defend digital rights.
-------------------------------------------------------------------------------
(Y)es/(N)o:Y【您是否愿意分享您的电子邮件地址,建议选择Y回车】
Please enter in your domain name(s) (comma and/or space separated) (Enter 'c'
to cancel): blog.renwole.com【输入域名回车】
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for blog.renwole.com
Select the webroot for blog.renwole.com:
-------------------------------------------------------------------------------
1: Enter a new webroot
//输入网站绝对路径
-------------------------------------------------------------------------------
Press 1 [enter] to confirm the selection (press 'c' to cancel):1【选择数字1回车】
Input the webroot for blog.renwole.com: (Enter 'c' to cancel):/home/www/blog.renwole.com【输入网站所在绝对路径回车】
Waiting for verification...
Waiting for verification...
Cleaning up challenges
Generating key (2048 bits): /etc/letsencrypt/keys/0001_key-certbot.pem
Creating CSR: /etc/letsencrypt/csr/0001_csr-certbot.pem IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at
/etc/letsencrypt/live/blog.renwole.com/fullchain.pem. Your cert
will expire on 2017-08-09. To obtain a new or tweaked version of
this certificate in the future, simply run certbot again. To
non-interactively renew *all* of your certificates, run "certbot
renew"
- If you like Certbot, please consider supporting our work by: Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF:

恭喜!您的SSL证书和密钥链接已保存,你的证书将于2017-08-09到期。

注意:这里需要说明,在生成证书之前,你必须保证nginx 443端口是运行状态,否则会生成证书失败。

若安装时遇到:Problem binding to port 80: Could not bind to IPv4 or IPv6.错误,则请关闭nginx服务再安装。

自动续签证书:

给系统添加个定时任务执行续签:

30 1 * * 1 /usr/bin/certbot renew >> /data0/certbot_renew_log/certbot_renew.log

每周一凌晨1点半执行证书更新

nginx安装Lets Encrypt SSL免费HTTPS加密证书的更多相关文章

  1. Nginx Configuration 免费HTTPS加密证书

    Linux就该这么学 2018-05-11 实验环境:CentOS Linux release 7.3.1611 (Core) 内核版本:Linux version 3.10.0-514.el7.x8 ...

  2. Ubuntu Nginx下配置网站ssl实现https访问

    最近在看  HTTP权威指南   看到介绍了HTTPS的ssl,自己就动手测试了下,将步骤记录下 HTTPS简介 什么是HTTPS?百科是这样解释的.HTTPS(全称:Hyper Text Trans ...

  3. TLS、SSL、HTTPS以及证书

    转自:http://www.cnblogs.com/kyrios/p/tls-and-certificates.html 最近在研究基于ssl的传输加密,涉及到了key和证书相关的话题,走了不少弯路, ...

  4. HTTPS加密证书流程(2)

    目录 一:HTTPS加密证书流程 二:证书对比 三:自签证书 1.(lb服务器负载均衡代理) 2.(创建CA证书 创建密码) 3.生成自签证书(公钥),同时去掉私钥的密码(Enter) 四:证书内容解 ...

  5. mkcert本地 HTTPS 加密证书生成工具

    软件介绍: mkcert 是一个生成本地 HTTPS 加密证书的工具,一个命令就可以生成证书,不需要任何配置. 下载地址: https://github.com/FiloSottile/mkcert/ ...

  6. 为阿里云域名配置免费SSL支持https加密访问简单教程

    阿里云之前有免费ssl入口申请,现在已经关闭了.那么现在怎么为自己的域名配置https呢? 首先打开阿里云域名控制台,如以下界面.(这里暂且用我的这个域名讲解吧)  如上图点击ssl证书,点击单域名免 ...

  7. 使用lets encrypt获取免费ssl证书

    lets encrypt也是一个CA,并且在众多大厂的加持下有可能成为最棒的免费颁发证书的CA,尤其是chrome的加入. 目前https已经成为了一种趋势,无奈证书授权费用相当昂贵,将一大批企业挡在 ...

  8. nginx 使用HTTPS协议-SSL证书模块报错解决-附nginx安装 : [emerg] the "ssl" parameter requires ngx_http_ssl_module in nginx.c

    Linux系统下ngnix使用HTTPS协议启动报错: nginx: [emerg] the "ssl" parameter requires ngx_http_ssl_modul ...

  9. Nginx和Tomcat配置SSL实现https访问

    环境:CentOS 7 Nginx版本: nginx/1.18.0 1. 安装nginx 详细步骤可以参考如下官网:http://nginx.org/en/linux_packages.html#RH ...

随机推荐

  1. ByValue和ByPropertyName的区别

    ByValue 以Get-Service命令为例,它的帮助文件中关于-Name参数是这样解释的: 1. "WinRM" | Get-Service 2. "Trusted ...

  2. ACM数论之旅2---快速幂,快速求a^b((ノ`Д´)ノ做人就要坚持不懈)

    a的b次方怎么求 pow(a, b)是数学头文件math.h里面有的函数 可是它返回值是double类型,数据有精度误差 那就自己写for循环咯 LL pow(LL a, LL b){//a的b次方 ...

  3. Iaas

    IaaS(Infrastructure as a Service),即基础设施即服务. 消费者通过Internet 可以从完善的计算机基础设施获得服务.这类服务称为基础设施即服务.基于 Interne ...

  4. QComboBox 树形视图选择

    QComboBox 控件支持树形图显示. A.  void QComboBox::setModel(QAbstractItemModel *model): B.  void QComboBox::se ...

  5. http站点如何启用为https站点?对收录的影响

    首先看一下百度官方对https站点的态度:百度开放收录https站点公告 百度搜索再次推出:全面支持https页面直接收录:另外从相关性的角度,百度搜索引擎认为权值相同的站点,采用https协议的页面 ...

  6. noi.acNOIP模拟赛5-count

    题目链接 戳我 题意简述 你有一个n+1个数的序列,都是1~n,其中只有一个有重复,求每个长度的本质不同的子序列个数.\(mod 1e9+7\). sol 说起来也很简单,设相同的数出现的位置为\(l ...

  7. Android Emoji兼容包使用详解

    Emoji兼容性 我们经常会遇到这样的问题: 给朋友发的emoji表情, 在自己手机上展示是正常的, 但是到朋友手机上, 却没有展示出来, 或者展示出来了, 但是也跟自己手机上展示的不一样. 所以,  ...

  8. 【bzoj2438】 中山市选2011—杀人游戏

    http://www.lydsy.com/JudgeOnline/problem.php?id=2438 (题目链接) 题意 n个点的有向图,其中有一个是杀手,每个人成为杀手的概率相同.警察询问一个人 ...

  9. Java之字节数组和字符串的转换问题

    今天在使用字节流复制图片的时候发现一个问题,就是将字节数组转化为字符串的时候会出现长度不同的问题.这其实是个错误的操作. public static void main(String[] args) ...

  10. 【bzoj4231】回忆树

    题解: 树上的串匹配,模式串的总长$|S|$,令$\overline {S} $为$S$的反串: 对$S$和$\overline {S} $分别建自动机 $u -> v$可以分成三个部分去统计 ...