未加星标

How to install and use Let's Encrypt on a Ubuntu Server for SSL security

字体大小 | |
[系统(linux) 所属分类 系统(linux) | 发布者 店小二05 | 时间 2017 | 作者 红领巾 ] 0人收藏点击收藏

How to install and use Let's Encrypt on a Ubuntu Server for SSL security

Image: Jack Wallen

It's a pain to add an SSL certificate to a web server. Fortunately, on the LAMP platform, you can make this IT task significantly easier with the help of Let's Encrypt . Once this tool is installed, you can make short shrift of adding SSL certificates to your websites.

Let's walk through the process of installing and using Let's Encrypt. I'll demonstrate the process on a Ubuntu Server 16.04 and assume you already have your LAMP server running and serving up websites.

SEE: Job description: Security Architect (Tech Pro Research)

How to install Let's Encrypt

First, we must install Let's Encrypt. Before we issue the installation command, let's update apt with this command:

sudo apt-get update

After that completes, we'll issue the following command to install Let's Encrypt:

sudo apt-get install python-letsencrypt-apache

Depending upon your setup, you might see a number of dependencies to be installed; if you do, okay those installations and allow the process to complete. Once it's finished, you're ready to continue.

How to set up the SSL certificate

The next step is using letsencrypt to set up your certificate. Let's use the domain domain.com for our demonstration. ( Note: You must have a public-facing domain for this process, and the domain must be owned by you, have a DNS A record, and have a publicly routable IP address; otherwise, the process will fail.) In order to launch the interactive certificate setup, go back to your terminal window and issue the command (DOMAIN.COM is your actual domain):

sudo letsencrypt --apache -d DOMAIN.COM

The first window in the setup will ask for an email address (for notices and lost key recovery) ( Figure A ). Enter your email address and tab down to OK.

Figure A
How to install and use Let's Encrypt on a Ubuntu Server for SSL security

The Let's Encrypt interactive setup.

The next window you must agree to is the EULA. That's it―letsencrypt will do its thing and dump the original certificate files into /etc/letsencrypt/archive and create links to the most recent certificate files in /etc/letsencrypt/live (this is important after you've renewed your certificates...more on that in a bit). You can verify the status of the SSL certificate by pointing a browser to this link (DOMAIN.COM is your domain):

https://www.ssllabs.com/ssltest/analyze.html?d=DOMAIN.COM&latest How to set up auto renewal of SSL certificates

By default, letsencrypt creates certificates that are valid for only 90 days; because of this, you need to set up a process that will auto renew those certificates. Since this is linux, you can easily use cron for that job. To create a cronjob that will renew your certificates on the first day of every month at midnight, issue the command sudo crontab -e and then add the following:

0 0 1 * * /usr/bin/letsencrypt renew >> /var/log/letsencrypt-renew.log

Save and close that file. At this point, letsencrypt will automatically renew your certificate (by way of the letsencrypt-auto renew command) every month, so those certificates never expire.

Easy peasy

That's it―you just created SSL certificates for your domain with the help of an incredibly easy to use tool. After using this method, you'll never want to install a certificate in any other fashion.

本文系统(linux)相关术语:linux系统 鸟哥的linux私房菜 linux命令大全 linux操作系统

主题: UbuntuLinux
分页:12
转载请注明
本文标题:How to install and use Let's Encrypt on a Ubuntu Server for SSL security
本站链接:http://www.codesec.net/view/535136.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 系统(linux) | 评论(0) | 阅读(50)