4,461
edits
add php area and downgrading php 7 to php 5.6 |
→SSL/TLS: add Let's Encrypt free SSL certificate |
||
Line 75: | Line 75: | ||
$ openssl req -new -key server.key -out server.csr | $ openssl req -new -key server.key -out server.csr | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Let's Encrypt free SSL certificate === | |||
* ''Last tested on Ubuntu 14.04.2 LTS (trusty) | easy | less than ten minutes | 27 June 2016'' | |||
You can find all about '''Let's Encrypt''' initiative at their [https://letsencrypt.org/ website]. | |||
The most current instruction can be found at [https://www.eff.org/ EFF]'s [https://certbot.eff.org/ certbot] site. | |||
This one is for Ubuntu 14.04 (trusty) and pursues the easier-to-use option. I'm assuming that you have a sudo access, although that isn't an absolute requirement. | |||
==== Installation ==== | |||
Download the executable and make it executable. | |||
<source lang="bash" highlight="1,13"> | |||
$ sudo wget https://dl.eff.org/certbot-auto | |||
--2016-06-27 18:36:18-- https://dl.eff.org/certbot-auto | |||
Resolving dl.eff.org (dl.eff.org)... 173.239.79.196 | |||
Connecting to dl.eff.org (dl.eff.org)|173.239.79.196|:443... connected. | |||
HTTP request sent, awaiting response... 200 OK | |||
Length: 44115 (43K) [text/plain] | |||
Saving to: ‘certbot-auto’ | |||
100%[======================================================================================================================================================>] 44,115 --.-K/s in 0.001s | |||
2016-06-27 18:36:18 (67.8 MB/s) - ‘certbot-auto’ saved [44115/44115] | |||
$ sudo chmod a+x certbot-auto | |||
</source> | |||
I prefer to have this type of executable in <span class="path">/usr/local/bin/</span> folder. It will make it available for other users as well as make it easy add as a cronjob. The ownership is already correct if you used <code>sudo</code>. | |||
Typing <code>sudo certbot-auto --apache</code> in CLI will get you to an interactive menu that will list out all of your domains on Apache2 and will easily generate certificates and even add those Apache directives in the respective virtual domain configuration files (not 100%, but works most of the time). | |||
<code>certbot-auto</code> creates a folder in <span class="path">/etc/letsencrypt/</span> as a default. | |||
==== Adding more domains ==== | |||
After the initial installation, if you need to add more domains you can do it directly from the CLI. | |||
<source lang="bash"> | |||
$ sudo certbot-auto run --apache -d mydomain.net | |||
</source> | |||
==== Configuring to auto-renew certificate ==== | |||
<code>certbot-auto</code> can also auto-renew certificates by adding a command as a cronjob. | |||
<div class="cli"> | |||
0 1,13 * * * /usr/local/bin/certbot-auto renew --quiet --no-self-upgrade | |||
</div> | |||
Use crontab to update the cron jobs, and add the above line. | |||
<source lang="bash"> | |||
$ sudo crontab -e | |||
</source> | |||
[[Category:System administration]] | [[Category:System administration]] |