什么让我们加密?
多年来,购买,更新,安装和管理SSL证书使我不知所措,而且费用高昂且复杂。 现在, 让我们加密使它变得相当简单和免费。
Let's Encrypt是一家新兴的,免费,自动化和开放式证书颁发机构,由一家名为Internet Security Research Group的加利福尼亚公益组织提供给您-它也具有非营利地位。
其目标是使HTTPS成为默认的Internet浏览器协议,以确保Web上更高的隐私性和安全性。 Mozilla和电子前沿基金会是其白金赞助商中的两个:
让我们加密在12月进入公开测试版,现在我可以轻松地指导您浏览其服务。
在本教程中,我将引导您在我的一些网站上安装“让我们加密”,包括我的WordPress咨询网站http://lookahead.io (即将成为https://)。
在开始之前,请记住,我确实会尝试参加以下讨论。 如果您有任何问题或建议,请在下面发表评论,或通过Twitter @reifman与我联系 。
让我们加密功能摘要
让我们在与Apache一起使用的Python上运行Encrypt可以自动进行证书注册和续订,从而简化了为任何网站(包括WordPress)激活HTTPS功能的过程。
以下是“让我们加密”所带来的主要好处:
- 免费:拥有域名的任何人都可以免费注册受信任的证书。
- 自动: Apache Web服务器可以轻松获取证书,对其进行安全配置并自动管理续订。
- 安全: Let's Encrypt将通过证书颁发机构和帮助站点维护安全服务器来推进TLS安全最佳实践。
- 透明:所有证书交易均已公开记录并可供检查。
- 开放:自动发行和更新协议将作为开放标准发布。
- 合作社:让我们加密是一个使所有人受益的社区努力。
让我们加密安装SSL
首先更新服务器Apache Ubuntu。
sudo apt-get update
如果您的服务器上未安装Git,则最好安装它来安装Let's Encrypt:
sudo apt-get install git
安装后,将Let's Encrypt软件克隆到第三方应用程序的Apache opt子目录中:
sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
首先,我尝试在Fever新闻阅读器应用程序而非WordPress上安装Let's Encrypt。 我将其托管在http://fever.lookahead.io :
cd /opt/letsencrypt
./letsencrypt-auto --apache -d fever.lookahead.io
安装向导
首先,系统会要求您提供电子邮件地址:
然后显示服务条款:
让我们加密让您选择提供HTTPS作为辅助选项,或将所有流量定向到HTTPS:
几分钟即可完成:
您还将看到有关证书到期和续签的一些注意事项:
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at
/etc/letsencrypt/live/lookahead.io/fullchain.pem. Your cert will
expire on 2016-05-03. To obtain a new version of the certificate in
the future, simply run Let's Encrypt again.
- Your account credentials have been saved in your Let's Encrypt
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 Let's
Encrypt so making regular backups of this folder is ideal.
- If you like Let's Encrypt, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
在WordPress上安装
要在我的WordPress咨询站点上安装“让我们加密SSL”,就很简单。 仅有一个细微的差别。 我要求我们加密也支持www子域:
cd /opt/letsencrypt
./letsencrypt-auto --apache -d lookahead.io -d www.lookahead.io
您现在可以通过HTTP或HTTPS访问它,您将在这里结束, https : //lookahead.io :
SSL报告
您可以访问Qualys SSL Labs之类的网站,以获得有关SSL功能的网站报告:
https://www.ssllabs.com/ssltest/analyze.html?d=fever.lookahead.io
这是身份验证页面:
证书自动续订
自动续订也非常简单。 首先,我们获取续订脚本并赋予其执行特权:
sudo curl -L -o /usr/local/sbin/le-renew http://do.co/le-renew
sudo chmod +x /usr/local/sbin/le-renew
然后为每个域运行脚本:
sudo le-renew lookahead.io
Checking expiration date for fever.lookahead.io...
The certificate is up to date, no need for renewal (89 days left).
您可以设置一个cron作业以使其定期运行:
crontab -e
添加此行:
30 2 * * 1 /usr/local/sbin/le-renew lookahead.io >> /var/log/le-renew.log
故障排除
我确实遇到了一些我认为应该分享的怪癖。 当我为旧的Community Starter开源项目(根域和www)安装SSL时,Let's Encrypted出现此错误:
We were unable to find a vhost with a ServerName or Address of
│ www.communitystarter.org.
│ Which virtual host would you like to choose?
我在conf文件中设置了通配符别名:
<VirtualHost *:80>
ServerName communitystarter.org
ServerAlias *.communitystarter.org
DocumentRoot /var/www/communitystarter/
此更改已修复,并为www保留添加了别名:
<VirtualHost *:80>
ServerName communitystarter.org
ServerAlias www.communitystarter.org
ServerAlias *.communitystarter.org
DocumentRoot /var/www/communitystarter/
然后主页嵌入的Vimeo视频失败:
我只需要将iframe更改为Vimeo播放器即可使用HTTPS:
<!-- ***************** - START Video - ***************** -->
<div class="video-wrap video_left">
<div class="video-main">
<div class="video-frame">
<iframe src="https://player.vimeo.com/video/37639283" title="introduction to newscloud's community starter" scrolling="no" width="572" height="312" frameborder="0" marginheight="0"></iframe>
</div><!-- end video-frame -->
</div><!-- end video-main -->
<div class="video-sub">
<h2>NewsCloud's Community Starter</h2>
<p>Community Starter is a simple, affordable platform to launch social media communities and extend existing websites. It provides a suite of Facebook-connected interactive features that can help you host a vibrant online community for your neighborhood, topic, community group, nonprofit, membership association or city.</p>
<a href="/how-community-foundations-can-build-engaged-local-communities-with-newscloud.html" class="ka_button small_button small_tealgrey"><span>Start your community →</span></a><br class="clear" />
</div><!-- end video-sub -->
</div><!-- end video-wrap -->
<!-- ***************** - END Video - ***************** -->
问题解决了:
收盘时
我对社区目标“让我们的加密”轻松便捷地实现印象深刻。 各地的Web发布者都将从简单,免费的SSL中受益。 谢谢EFF,Mozilla和让我们加密!
您可以捐赠给我们加密或EFF支持这项工作:
您可以在此处了解有关其软件的更多技术细节 。 让我们加密还有一个结构良好的社区论坛 :
下一步是什么?
让我们加密正在积极完成其第一个公开发行版:
在我们完全放弃beta标签之前,我们还有很多工作要做,尤其是在客户体验方面。 自动化是我们战略的基石,我们需要确保客户端在各种平台上都能平稳可靠地工作。
为了跟上最新代码,只需偶尔更新您的git树:
cd /opt/letsencrypt
sudo git pull
我的主要WordPress网站当前与Varnish 3.x一起运行。 使用“加密”功能无法立即使用。 我可能会花一些时间很快找到解决方案。
同时,如果您正在寻找其他实用程序来帮助您构建不断增长的WordPress工具集或用于研究代码并精通WordPress的代码,请别忘了看看Envato中提供的功能市场 。
如有疑问,请在下面发布。 或者,您可以通过Twitter @reifman与我联系 。 请查看我的Envato Tuts +讲师页面,以查看我编写的其他教程,例如在Linux中(在90秒内)克隆WordPress 。
相关链接
- 让我们加密
- 如何通过在Ubuntu 14.04(数字海洋)上进行加密来保护Apache的安全
- 如何在Ubuntu 14.04(Digital Ocean)上使用Let's Encrypt来保护Nginx
翻译自: https://code.tutsplus.com/tutorials/using-lets-encrypt-ssl-with-your-wordpress-project--cms-22303