nginx安装Lets Encrypt SSL免费HTTPS加密证书

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):[email protected]【输入您的邮箱地址,用于紧急更新和安全通知】

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点半执行证书更新

原文地址:https://www.cnblogs.com/manzb/p/8534240.html

时间: 2024-08-04 05:47:29

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

nginx 配置lets Encrypt永久免费SSL证书过程教程

云服务商:阿里云 服务器:针对Nginx服务器: 假设域名:example.com www.example.com 假设IP:137.137.137.137 1,先安装nginx服务器 sudo apt-get install nginx sudo service nginx start 2,安装letsencrypt sudo apt-get install letsencrypt 3,签发证书 很简单,直接运行letsencrypt命令即可sudo letsencrypt certonly

let's encrypt生成免费https证书 ubuntu+tomcat+nginx+let's encrypt

1. 下载let's encrypt $ sudo add-apt-repository ppa:certbot/certbot $ sudo apt-get update $ sudo apt-get install certbot 2. 生成密钥,调用之前需要停止nginx certbot certonly --standalone -d www.域名1.com -d www.域名2.com 生成成功,提示如下 IMPORTANT NOTES: - Congratulations! Your

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

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

Nginx下配置网站SSL实现https访问本站就是用的这方法

本文出至:新太潮流网络博客 第一步:服务器环境,lnmp即Linux+Nginx+PHP+MySQL,本文中以我的博客为例,使用的是阿里云最低档的ECS+免费的Linux服务器管理系统WDCP快速搭建的lnamp环境,具体安装以及使用方法都可以在其官方论坛找到详细的操作文档. 第二步:创建你的网站,使用lnamp环境创建你的网站,已有网站的,确保你的程序在lnamp下能够正常的运行,以wordpress为例,lamp跟lnamp下的伪静态规则是不同的,有过更换的,要记得切换. 第三步:申请免费的

使用openssl生成ssl(https)证书

openssl生成证书 [[email protected] key]$ pwd/app/nginx/key 生成私钥openssl genrsa -out server.key 2048 生成证书请求openssl req -new -key server.key -out server.csr 填入信息 [[email protected] key]$ openssl req -new -key server.key -out server.csr You are about to be a

nginx多站点,ssl偏爱第一个证书

一个老旧的系统上,部署了nginx及php,今天启用新的ssl证书,在nginx上做了设置,执行nginx -t语法检查没有问题.但重载nginx以后,浏览器访问站点失败,提示证书问题,查看证书,确是同一个nginx下另外一个站点的证书. 再查那个站点的配置,也启用的自己的ssl证书,但这个证书早过期了.于是咨询其它人,问能不能临时把这个ssl配置给取消掉,反正也是过期的证书,也没啥用.再保证不影响其它业务的前提下,我把配置文件(nginx主配置文件以include形式包含单独的文件,不是那种i

Let's Encrypt: 为CentOS/RHEL 7下的nginx安装https支持-具体案例

环境说明: centos 7 nginx 1.10.2 前期准备 软件安装 yum install -y epel-release yum install -y certbot 创建目录及链接 方法1:在网站根目录下创建一个.well-known的目录 方法2: mkdir -p /usr/local/nginx/cert/.well-known ln -s /usr/local/nginx/cert/.well-known /data/www/example.com/.well-known l

【Nginx】使用certbot安装免费https证书使Nginx支持Https请求

certbot官网:https://certbot.eff.org/lets-encrypt/centosrhel7-nginx 一.安装步骤 1)安装certbot,执行  sudo yum install certbot python2-certbot-nginx 2)检查是否安装成功,执行  certbot --help [[email protected] ~]# certbot --help Traceback (most recent call last): File "/usr/b

https(ssl)免费证书申请及nginx配置https(ssl)

首先推荐免费证书的申请url:https://freessl.org/ 然后就是上面证书申请的流程,这里可以参考一篇阿里云里面的博文(我会补充一些细节): https://yq.aliyun.com/articles/225669?spm=5176.10695662.1996646101.searchclickresult.1da01cb9Hyk86J freessl免费证书申请补充: 一.补充一下配置DNS验证的流程,我这里用的是阿里云: 然后点击添加记录 确定 完成,全选,启用一下就可以了: