在CentOS6,CentOS7安装 Let'sEncrypt 免费SSL安全证书
相对来说,个人网站建立SSL是昂贵的,而且往往过程繁琐。一个标准的2048位证书费用至少150美元/年,网站除了要支付一笔昂贵的费用、重新配置Web服务器,并需要解决大量的配置错误。这让广大中小网站望而生畏。
然而,Let's Encrypt免费证书的开放,极大推进了国内 HTTPS 的进程。Let's Encrypt 真正的意义在于,它推动了 HTTPS 在小型网站和个人网站中的应用,加速全面 HTTPS 时代的到来。Let's Encrypt 的最大贡献是它的 ACME 协议,第一份全自动服务器身份验证协议,以及配套的基础设施和客户端。这是为了解决一直以来 HTTPS TLS X.509 PKI 信任模型,即证书权威(Certificate Authority, CA)模型缺陷的一个起步。
Let'sEncrypt的工作原理
看图:

ACME 解决了私钥持有者验证自己身份这一过程的自动化问题。
在CentOS6,CentOS7上安装Let's Encrypt
非营利组织电子前沿基金会的CertBot是一个很好的工具,我们使用它来安装Let's Encrypt
一、升级系统
- # yum -y update
二、安装EPEL库,为CertBot提供最新的Python包。
- # yum -y install epel-release
三、下载CertBot
1、CentOS7:
- # yum -y install python-certbot-apache
2、CentOS6:
- # wget https://dl.eff.org/certbot-auto
- # chmod 755 certbot-auto
四、Apache下配置Let's Encrypt
执行下条命令
- # ./certbot-auto --apache
根据提示操作
- /root/.local/share/letsencrypt/lib/python2.6/site-packages/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography will drop support for Python 2.6
- DeprecationWarning
- Saving debug log to /var/log/letsencrypt/letsencrypt.log
- Enter email address (used for urgent renewal and security notices) (Enter 'c' to
- cancel):输入管理员邮箱
- -------------------------------------------------------------------------------
- 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
- -------------------------------------------------------------------------------
- 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
- Which names would you like to activate HTTPS for?
- -------------------------------------------------------------------------------
- 1: www.xi-chuang.com
- -------------------------------------------------------------------------------
- Select the appropriate numbers separated by commas and/or spaces, or leave input
- blank to select all options shown (Enter 'c' to cancel):1
- Obtaining a new certificate
成功后,在/etc/letsencrypt/live/www.xi-chuang.com/下生成4个证书:
- cert.pem ->
- chain.pem ->
- fullchain.pem ->
- privkey.pem ->
五、打开防火墙iptables的443端口
- -A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
- #service iptables restart
六、编辑ssl.conf
vi /etc/httpd/conf.d/ssl.conf
- # General setup for the virtual host, inherited from global configuration
- DocumentRoot "/var/www/html/xi-chuang.com"
- ServerName www.xi-chuang.com:443
- .
- .
- .
- SSLCertificateFile /etc/letsencrypt/live/www.xi-chuang.com/fullchain.pem
- .
- .
- .
- SSLCertificateKeyFile /etc/letsencrypt/live/www.xi-chuang.com/privkey.pem
- .
- .
- .
service httpd restart
七、这个时候网站HTTPS已经能够访问了,试一下
最后,通过.htaccess进行301转向
- RewriteEngine On
- RewriteCond %{SERVER_PORT} 80
- RewriteRule ^(.*)$ https://www.xi-chuang.com/$1 [R=301,L]
- RewriteCond %{HTTP_HOST} !^www.xi-chuang.com$ [NC]
- RewriteRule ^(.*)$ https://www.xi-chuang.com/$1 [L,R=301]
八、大功告成
注意:Let'sEncrypt的证书有效期为90天,因此,建议使用cron作业在证书到期前一周将证书renew
在CentOS6,CentOS7安装 Let'sEncrypt 免费SSL安全证书的更多相关文章
- 去freessl.org申请免费ssl服务器证书
去freessl.org申请免费ssl服务器证书 来源: 本文链接 来自osnosn的博客 写于: 2019-03-30. 想搞个自签名证书,可以参考这篇: 用openssl为WEB服务器生成证书(自 ...
- 申请安装阿里云免费SSL证书
微信小程序已经全面要求使用HTTPS服务了,还有苹果商店也是,所以,实现网站HTTPS已经很有必要.要实现HTTPS就需要一个SSL证书,证书大部分都很贵,不过也有一些免费的证书服务供个人开发者使用. ...
- centos6 / centos7 安装apache
=================centos6.1 安装apache===================== 安装: yum -y install httpd 启动 /etc/init.d/htt ...
- 免费 SSL 安全证书
为了保证网上传输信息的安全而在自己的 Linode VPS 上部署 SSL 加密服务.商业 CA 较贵,所以使用了自己签发的 CA.网友神爱的留言提到了 StartSSL 的免费 CA,稍做了一些调查 ...
- 云栖社区> > 正文 永久免费SSL安全证书Letsencrypt安装使用方法
./letsencrypt-auto certonly --standalone --email admin@thing.com -d thing.com -d www.thing.com
- 【转】IIS - 自动申请、部署Let's Encrypt的免费SSL证书
IIS - 自动申请.部署Let's Encrypt的免费SSL证书(让网站实现HTTPS协议) 2017-12-19发布:hangge阅读:161 一.HTTPS 协议介绍 1,什么是 HTTP ...
- IIS - 自动申请、部署Let's Encrypt的免费SSL证书(让网站实现HTTPS协议)
IIS - 自动申请.部署Let's Encrypt的免费SSL证书(让网站实现HTTPS协议) 2017-12-19发布:hangge阅读:161 一.HTTPS 协议介绍 1,什么是 HTTP ...
- Let'sEncrypt 免费通配符/泛域名SSL证书添加使用教程
Let'sEncrypt 免费通配符/泛域名SSL证书添加使用教程 通配符证书一般还是比较贵的一般最便宜的通配符证书5.60美元一年,只不过Let'sEncrypt的有效期是3个月,对于一般用户来说基 ...
- LNMP安装Let’s Encrypt 免费SSL证书方法:自动安装与手动配置Nginx
前几天介绍了最新StartSSL免费SSL申请与配置,很多人看到部落介绍SSL证书安装时总是推荐了OneinStack,因为OneinStack提供了一键添加和配置Let's Encrypt 免费SS ...
随机推荐
- 18、Java并发性和多线程-饥饿与公平
以下内容转自http://ifeve.com/starvation-and-fairness/: 如果一个线程因为CPU时间全部被其他线程抢走而得不到CPU运行时间,这种状态被称之为“饥饿”.而该线程 ...
- golang中channels的本质详解,经典!
原文:https://www.goinggo.net/2014/02/the-nature-of-channels-in-go.html The Nature Of Channels In Go 这篇 ...
- C语言实现单链表节点的删除(带头结点)
我在之前一篇博客<C语言实现单链表节点的删除(不带头结点)>中具体实现了怎样在一个不带头结点的单链表的删除一个节点,在这一篇博客中我改成了带头结点的单链表.代码演示样例上传至 https: ...
- spring装配集合
前面我们已经了解了怎样使用spring装备简单的属性(使用value属性)和引用其它bean的属性(使用ref属性).可是value和ref仅在Bean的属性值是单个值的情况下才实用.当bean的属性 ...
- Android 自己定义Activity基类
我们在开发App的时候有时候碰到多个界面有一个共同点的时候.比方,都有同样的TitleBar.而且TitleBar能够设置显示的文字.TitleBar上的点击事件,假设给每个Activity都写一遍T ...
- Android离线语音识别(PocketSphinx)
近期做项目.用到离线语音识别.整了好久,查了好多方法.最终完毕.网上资料有点乱,并且大部分就是那几个人写的.一群人转!以下我总结一下.也为后来人行个方便. 关于环境配置我就不多说了.我就是依照这个教程 ...
- Android 自己定义圆圈进度并显示百分比例控件(纯代码实现)
首先,感谢公司能给我闲暇的时间,来稳固我的技术,让我不断的去探索研究,在此不胜感激. 先不说实现功能,上图看看效果 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZ ...
- P1656 炸铁路
P1656 炸铁路 81通过 286提交 题目提供者kkksc03 标签图论搜索/枚举洛谷原创 难度普及+/提高 提交该题 讨论 题解 记录 最新讨论 暂时没有讨论 题目描述 因为某国被某红色政权残酷 ...
- Jboss 7配置日志
1. Jboss7配置日志理论知识介绍 Jboss 7日志能够在XML配置文件和日志管理属性文件内配置.默认日志配置在configuration文件夹的logging.properties文件内. 通 ...
- Uva 10036 - Divisibility
Consider an arbitrary sequence of integers. One can place + or - operators between integers in the s ...