{"id":30,"date":"2020-12-08T22:28:46","date_gmt":"2020-12-08T13:28:46","guid":{"rendered":"https:\/\/www.spacek.xyz\/mle\/?p=30"},"modified":"2020-12-08T22:31:41","modified_gmt":"2020-12-08T13:31:41","slug":"ubuntu-%ec%97%90%ec%84%9c-certbot%ec%9d%84-%ec%82%ac%ec%9a%a9%ed%95%98%ec%97%ac-%eb%ac%b4%eb%a3%8c-ssl-%ec%84%9c%eb%b2%84-%ea%b5%ac%ec%b6%95%ed%95%98%ec%9e%90","status":"publish","type":"post","link":"https:\/\/www.spacek.xyz\/mle\/?p=30","title":{"rendered":"Ubuntu \uc5d0\uc11c CertBot\uc744 \uc0ac\uc6a9\ud558\uc5ec \ubb34\ub8cc SSL \uc11c\ubc84 \uad6c\ucd95\ud558\uc790"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\uc0ac\uc6a9\uae30\uac04\uc774 \uc81c\ud55c\ub41c \ubb34\ub8cc \uc0c1\uc5c5\uc6a9 ssl \uc778\uc99d\uc11c\ub97c \uc0ac\uc6a9\ud558\uac70\ub098 Self \uc778\uc99d\uc11c\ub97c \uc0ac\uc6a9\ud558\uc5ec \ubcf4\uc558\uc9c0\ub9cc \ubb34\ub8cc \uae30\uac04\uc774 \uc9c0\ub098\uba74 \uc0ac\uc6a9\ud558\uc9c0 \ubabb\ud558\uace0 \uc0ac\uc124 \uc778\uc99d\uc11c\ub294 \ube0c\ub77c\uc6b0\uc800\uc5d0\uc11c \uc81c\ub300\ub85c \uc0ac\uc6a9\ud558\uae30\uac00 \uc5b4\ub824\uc6e0\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud574\uacb0 \ubc29\ubc95\uc744 \ucc3e\ub2e4\uac00 CertBot\uc744 \uc774\uc6a9\ud558\uc5ec \uc790\ub3d9\uc73c\ub85c \uac31\uc2e0\uae4c\uc9c0 \ud574\uc900\ub2e4\ub294 \ub0b4\uc6a9\uc744 \ubcf4\uace0 \uc801\uc6a9\ud574\ubcf4\uc558\ub2e4. \uadf8\ub7f0\ub370 \ub73b\ubc16\uc5d0\ub3c4 \ud06c\ub86c \ube0c\ub77c\uc6b0\uc800\uc5d0\uc11c \ubcc4\ub3c4\uc758 \uacbd\uace0 \uba54\uc2dc\uc9c0\ub3c4 \uc5c6\uc774 https \ub85c \ubc14\ub85c \uc870\ud68c\uac00 \ub41c\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ub9c8\uce58 \ud6a1\uc7ac\ub97c \ud55c \uae30\ubd84\uc73c\ub85c \ucc38\uc870\ud55c \uc0ac\uc774\ud2b8\ub97c \uc18c\uac1c\ud55c\ub2e4.  \uc544\ub798  url link\uac00 \ucc38\uc870\ud55c \uc6d0\ubcf8 \uc0ac\uc774\ud2b8 \uc774\ub2e4. \uac00\ub054 \uc0ac\uc774\ud2b8\uac00 \uc0ac\ub77c\uc9c0\uac70\ub098 \ub2eb\ud788\ub294 \uacbd\uc6b0\uac00 \uc788\uc5b4 \ud398\uc774\uc9c0\uc758 \ub0b4\uc6a9\uc744 \ubcf5\uc0ac\ud574 \ub193\ub294\ub2e4. \uc774 \ub0b4\uc6a9\uc744 \ucc38\uc870\ud558\uace0\uc790 \ud55c\ub2e4\uba74 \uc544\ub798 \ub9c1\ud06c\ub97c \ud074\ub9ad\ud574\uc11c \uc6d0\ubcf8\uc744 \ucc38\uc870\ud558\uae30 \ubc14\ub780\ub2e4.<br>\uc544\ub798 \ubcf5\uc0ac\ud55c \ub0b4\uc6a9\uc740 \ubc31\uc5c5\uc744 \uc704\ud558\uc5ec \ubcf5\uc0ac\ud55c \uac83\uc73c\ub85c \ud3ec\ub9f7\ub3c4 \ubd88\ub7c9\uc774\uace0 \uc6d0\ubcf8 \ubcf4\ub2e4 \ubcf4\uae30\uac00 \uc88b\uc9c0 \uc54a\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-20-04\">https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-20-04<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"introduction\">Introduction<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s Encrypt is a Certificate Authority (CA) that facilitates obtaining and installing free&nbsp;<a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/openssl-essentials-working-with-ssl-certificates-private-keys-and-csrs\">TLS\/SSL certificates<\/a>, thereby enabling encrypted HTTPS on web servers. It simplifies the process by providing a software client, Certbot, that attempts to automate most (if not all) of the required steps. Currently, the entire process of obtaining and installing a certificate is fully automated on both Apache and Nginx.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this guide, we\u2019ll use&nbsp;<a href=\"https:\/\/certbot.eff.org\/\">Certbot<\/a>&nbsp;to obtain a free SSL certificate for Apache on Ubuntu 20.04, and make sure this certificate is set up to renew automatically.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This tutorial uses a separate virtual host file instead of Apache\u2019s default configuration file for setting up the website that will be secured by Let\u2019s Encrypt.&nbsp;<a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-the-apache-web-server-on-ubuntu-20-04#step-5-%E2%80%94-setting-up-virtual-hosts-(recommended)\">We recommend<\/a>&nbsp;creating new Apache virtual host files for each domain hosted in a server, because it helps to avoid common mistakes and maintains the default configuration files as a fallback setup.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"prerequisites\">Prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To follow this tutorial, you will need:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>One Ubuntu 20.04 server set up by following this&nbsp;<a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/initial-server-setup-with-ubuntu-20-04\">initial server setup for Ubuntu 20.04<\/a>&nbsp;tutorial, including a sudo non-root user and a firewall.<\/li><li>A fully registered domain name. This tutorial will use&nbsp;<strong>your_domain<\/strong>&nbsp;as an example throughout. You can purchase a domain name on&nbsp;<a href=\"https:\/\/namecheap.com\/\">Namecheap<\/a>, get one for free on&nbsp;<a href=\"http:\/\/www.freenom.com\/en\/index.html\">Freenom<\/a>, or use the domain registrar of your choice.<\/li><li>Both of the following DNS records set up for your server. You can follow&nbsp;<a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/an-introduction-to-digitalocean-dns\">this introduction to DigitalOcean DNS<\/a>&nbsp;for details on how to add them.<ul><li>An A record with&nbsp;<code>your_domain<\/code>&nbsp;pointing to your server\u2019s public IP address.<\/li><li>An A record with&nbsp;<code>www.your_domain<\/code>&nbsp;pointing to your server\u2019s public IP address.<\/li><\/ul><\/li><li>Apache installed by following&nbsp;<a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-the-apache-web-server-on-ubuntu-20-04\">How To Install Apache on Ubuntu 20.04<\/a>. Be sure that you have a&nbsp;<a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-the-apache-web-server-on-ubuntu-20-04#step-5-%E2%80%94-setting-up-virtual-hosts-recommended\">virtual host file<\/a>&nbsp;for your domain. This tutorial will use&nbsp;<code>\/etc\/apache2\/sites-available\/your_domain.conf<\/code>&nbsp;as an example.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-1-\u2014-installing-certbot\">Step 1 \u2014 Installing Certbot<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In order to obtain an SSL certificate with Let\u2019s Encrypt, we\u2019ll first need to install the Certbot software on your server. We\u2019ll use the default Ubuntu package repositories for that.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We need two packages:&nbsp;<code>certbot<\/code>, and&nbsp;<code>python3-certbot-apache<\/code>. The latter is a plugin that integrates Certbot with Apache, making it possible to automate obtaining a certificate and configuring HTTPS within your web server with a single command.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt install certbot python3-certbot-apache\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Copy<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You will be prompted to confirm the installation by pressing&nbsp;<code>Y<\/code>, then&nbsp;<code>ENTER<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Certbot is now installed on your server. In the next step, we\u2019ll verify Apache\u2019s configuration to make sure your virtual host is set appropriately. This will ensure that the&nbsp;<code>certbot<\/code>&nbsp;client script will be able to detect your domains and reconfigure your web server to use your newly generated SSL certificate automatically.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-2-\u2014-checking-your-apache-virtual-host-configuration\">Step 2 \u2014 Checking your Apache Virtual Host Configuration<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In order to be able to automatically obtain and configure SSL for your web server, Certbot needs to find the correct virtual host within your Apache configuration files. Your server domain name(s) will be retrieved from the&nbsp;<code>ServerName<\/code>&nbsp;and&nbsp;<code>ServerAlias<\/code>&nbsp;directives defined within your&nbsp;<code>VirtualHost<\/code>&nbsp;configuration block.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you followed the&nbsp;<a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-the-apache-web-server-on-ubuntu-20-04#step-5-%E2%80%94-setting-up-virtual-hosts-(recommended)\">virtual host setup step in the Apache installation tutorial<\/a>, you should have a VirtualHost block set up for your domain at&nbsp;<code>\/etc\/apache2\/sites-available\/your_domain.conf<\/code>&nbsp;with the&nbsp;<code>ServerName<\/code>&nbsp;and also the&nbsp;<code>ServerAlias<\/code>&nbsp;directives already set appropriately.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To check this up, open the virtual host file for your domain using&nbsp;<code>nano<\/code>&nbsp;or your preferred text editor:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo nano \/etc\/apache2\/sites-available\/your_domain.conf\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Copy<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Find the existing&nbsp;<code>ServerName<\/code>&nbsp;and&nbsp;<code>ServerAlias<\/code>&nbsp;lines. They should look like this:\/etc\/apache2\/sites-available\/your_domain.conf<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">...\nServerName your_domain\nServerAlias www.your_domain\n...<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Copy<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you already have your&nbsp;<code>ServerName<\/code>&nbsp;and&nbsp;<code>ServerAlias<\/code>&nbsp;set up like this, you can exit your text editor and move on to the next step. If you\u2019re using&nbsp;<code>nano<\/code>, you can exit by typing&nbsp;<code>CTRL+X<\/code>, then&nbsp;<code>Y<\/code>&nbsp;and&nbsp;<code>ENTER<\/code>&nbsp;to confirm.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If your current virtual host configuration doesn\u2019t match the example, update it accordingly. When you\u2019re done, save the file and quit the editor. Then, run the following command to validate your changes:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apache2ctl configtest\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Copy<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You should get a&nbsp;<code>Syntax OK<\/code>&nbsp;as a response. If you get an error, reopen the virtual host file and check for any typos or missing characters. Once your configuration file\u2019s syntax is correct, reload Apache so that the changes take effect:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo systemctl reload apache2\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Copy<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With these changes, Certbot will be able to find the correct VirtualHost block and update it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, we\u2019ll update the firewall to allow HTTPS traffic.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-3-\u2014-allowing-https-through-the-firewall\">Step 3 \u2014 Allowing HTTPS Through the Firewall<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you have the UFW firewall enabled, as recommended by the prerequisite guides, you\u2019ll need to adjust the settings to allow HTTPS traffic. Upon installation, Apache registers a few different UFW application profiles. We can leverage the&nbsp;<strong>Apache Full<\/strong>&nbsp;profile to allow both HTTP and HTTPS traffic on your server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To verify what kind of traffic is currently allowed on your server, you can use:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo ufw status\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Copy<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you have followed one of our Apache installation guides, your output should look something like this, meaning that only HTTP traffic on port&nbsp;<code>80<\/code>&nbsp;is currently allowed:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">OutputStatus: active\n\nTo                         Action      From\n--                         ------      ----\nOpenSSH                    ALLOW       Anywhere                  \nApache                     ALLOW       Anywhere             \nOpenSSH (v6)               ALLOW       Anywhere (v6)             \nApache (v6)                ALLOW       Anywhere (v6)\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To additionally let in HTTPS traffic, allow the \u201cApache Full\u201d profile and delete the redundant \u201cApache\u201d profile:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo ufw allow 'Apache Full'\nsudo ufw delete allow 'Apache'\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Copy<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Your status will now look like this:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo ufw status\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Copy<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">OutputStatus: active\n\nTo                         Action      From\n--                         ------      ----\nOpenSSH                    ALLOW       Anywhere                  \nApache Full                ALLOW       Anywhere                  \nOpenSSH (v6)               ALLOW       Anywhere (v6)             \nApache Full (v6)           ALLOW       Anywhere (v6)        \n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You are now ready to run Certbot and obtain your certificates.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-4-\u2014-obtaining-an-ssl-certificate\">Step 4 \u2014 Obtaining an SSL Certificate<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Certbot provides a variety of ways to obtain SSL certificates through plugins. The Apache plugin will take care of reconfiguring Apache and reloading the configuration whenever necessary. To use this plugin, type the following:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo certbot --apache\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Copy<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This script will prompt you to answer a series of questions in order to configure your SSL certificate. First, it will ask you for a valid e-mail address. This email will be used for renewal notifications and security notices:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">OutputSaving debug log to \/var\/log\/letsencrypt\/letsencrypt.log\nPlugins selected: Authenticator apache, Installer apache\nEnter email address (used for urgent renewal and security notices) (Enter 'c' to\ncancel): you@your_domain\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After providing a valid e-mail address, hit&nbsp;<code>ENTER<\/code>&nbsp;to proceed to the next step. You will then be prompted to confirm if you agree to Let\u2019s Encrypt terms of service. You can confirm by pressing&nbsp;<code>A<\/code>&nbsp;and then&nbsp;<code>ENTER<\/code>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nPlease read the Terms of Service at\nhttps:\/\/letsencrypt.org\/documents\/LE-SA-v1.2-November-15-2017.pdf. You must\nagree in order to register with the ACME server at\nhttps:\/\/acme-v02.api.letsencrypt.org\/directory\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n(A)gree\/(C)ancel: A\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Next, you\u2019ll be asked if you would like to share your email with the Electronic Frontier Foundation to receive news and other information. If you do not want to subscribe to their content, type&nbsp;<code>N<\/code>. Otherwise, type&nbsp;<code>Y<\/code>. Then, hit&nbsp;<code>ENTER<\/code>&nbsp;to proceed to the next step.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nWould you be willing to share your email address with the Electronic Frontier\nFoundation, a founding partner of the Let's Encrypt project and the non-profit\norganization that develops Certbot? We'd like to send you email about our work\nencrypting the web, EFF news, campaigns, and ways to support digital freedom.\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n(Y)es\/(N)o: N\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The next step will prompt you to inform Certbot of which domains you\u2019d like to activate HTTPS for. The listed domain names are automatically obtained from your Apache virtual host configuration, that\u2019s why it\u2019s important to make sure you have the correct&nbsp;<code>ServerName<\/code>&nbsp;and&nbsp;<code>ServerAlias<\/code>&nbsp;settings configured in your virtual host. If you\u2019d like to enable HTTPS for all listed domain names (recommended), you can leave the prompt blank and hit&nbsp;<code>ENTER<\/code>&nbsp;to proceed. Otherwise, select the domains you want to enable HTTPS for by listing each appropriate number, separated by commas and\/ or spaces, then hit&nbsp;<code>ENTER<\/code>.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Which names would you like to activate HTTPS for?\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n1: your_domain\n2: www.your_domain\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nSelect the appropriate numbers separated by commas and\/or spaces, or leave input\nblank to select all options shown (Enter 'c' to cancel): \n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You\u2019ll see output like this:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Obtaining a new certificate\nPerforming the following challenges:\nhttp-01 challenge for your_domain\nhttp-01 challenge for www.your_domain\nEnabled Apache rewrite module\nWaiting for verification...\nCleaning up challenges\nCreated an SSL vhost at \/etc\/apache2\/sites-available\/your_domain-le-ssl.conf\nEnabled Apache socache_shmcb module\nEnabled Apache ssl module\nDeploying Certificate to VirtualHost \/etc\/apache2\/sites-available\/your_domain-le-ssl.conf\nEnabling available site: \/etc\/apache2\/sites-available\/your_domain-le-ssl.conf\nDeploying Certificate to VirtualHost \/etc\/apache2\/sites-available\/your_domain-le-ssl.conf\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Next, you\u2019ll be prompted to select whether or not you want HTTP traffic redirected to HTTPS. In practice, that means when someone visits your website through unencrypted channels (HTTP), they will be automatically redirected to the HTTPS address of your website. Choose&nbsp;<code>2<\/code>&nbsp;to enable the redirection, or&nbsp;<code>1<\/code>&nbsp;if you want to keep both HTTP and HTTPS as separate methods of accessing your website.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n1: No redirect - Make no further changes to the webserver configuration.\n2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for\nnew sites, or if you're confident your site works on HTTPS. You can undo this\nchange by editing your web server's configuration.\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nSelect the appropriate number [1-2] then [enter] (press 'c' to cancel): 2\n\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After this step, Certbot\u2019s configuration is finished, and you will be presented with the final remarks about your new certificate, where to locate the generated files, and how to test your configuration using an external tool that analyzes your certificate\u2019s authenticity:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nCongratulations! You have successfully enabled https:\/\/your_domain and\nhttps:\/\/www.your_domain\n\nYou should test your configuration at:\nhttps:\/\/www.ssllabs.com\/ssltest\/analyze.html?d=your_domain\nhttps:\/\/www.ssllabs.com\/ssltest\/analyze.html?d=www.your_domain\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n\nIMPORTANT NOTES:\n - Congratulations! Your certificate and chain have been saved at:\n   \/etc\/letsencrypt\/live\/your_domain\/fullchain.pem\n   Your key file has been saved at:\n   \/etc\/letsencrypt\/live\/your_domain\/privkey.pem\n   Your cert will expire on 2020-07-27. To obtain a new or tweaked\n   version of this certificate in the future, simply run certbot again\n   with the \"certonly\" option. To non-interactively renew *all* of\n   your certificates, run \"certbot renew\"\n - Your account credentials have been saved in your Certbot\n   configuration directory at \/etc\/letsencrypt. You should make a\n   secure backup of this folder now. This configuration directory will\n   also contain certificates and private keys obtained by Certbot so\n   making regular backups of this folder is ideal.\n - If you like Certbot, please consider supporting our work by:\n\n   Donating to ISRG \/ Let's Encrypt:   https:\/\/letsencrypt.org\/donate\n   Donating to EFF:                    https:\/\/eff.org\/donate-le\n\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Your certificate is now installed and loaded into Apache\u2019s configuration. Try reloading your website using&nbsp;<code>https:\/\/<\/code>&nbsp;and notice your browser\u2019s security indicator. It should point out that your site is properly secured, typically by including a lock icon in the address bar.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can use the&nbsp;<a href=\"https:\/\/www.ssllabs.com\/ssltest\/\">SSL Labs Server Test<\/a>&nbsp;to verify your certificate\u2019s grade and obtain detailed information about it, from the perspective of an external service.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the next and final step, we\u2019ll test the auto-renewal feature of Certbot, which guarantees that your certificate will be renewed automatically before the expiration date.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-5-\u2014-verifying-certbot-auto-renewal\">Step 5 \u2014 Verifying Certbot Auto-Renewal<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s Encrypt\u2019s certificates are only valid for ninety days. This is to encourage users to automate their certificate renewal process, as well as to ensure that misused certificates or stolen keys will expire sooner rather than later.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The&nbsp;<code>certbot<\/code>&nbsp;package we installed takes care of renewals by including a renew script to&nbsp;<code>\/etc\/cron.d<\/code>, which is managed by a&nbsp;<code>systemctl<\/code>&nbsp;service called&nbsp;<code>certbot.timer<\/code>. This script runs twice a day and will automatically renew any certificate that\u2019s within thirty days of expiration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To check the status of this service and make sure it\u2019s active and running, you can use:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo systemctl status certbot.timer\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Copy<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You\u2019ll get output similar to this:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Output\u25cf certbot.timer - Run certbot twice daily\n     Loaded: loaded (\/lib\/systemd\/system\/certbot.timer; enabled; vendor preset: enabled)\n     Active: active (waiting) since Tue 2020-04-28 17:57:48 UTC; 17h ago\n    Trigger: Wed 2020-04-29 23:50:31 UTC; 12h left\n   Triggers: \u25cf certbot.service\n\nApr 28 17:57:48 fine-turtle systemd[1]: Started Run certbot twice daily.\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To test the renewal process, you can do a dry run with&nbsp;<code>certbot<\/code>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo certbot renew --dry-run\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Copy<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you see no errors, you\u2019re all set. When necessary, Certbot will renew your certificates and reload Apache to pick up the changes. If the automated renewal process ever fails, Let\u2019s Encrypt will send a message to the email you specified, warning you when your certificate is about to expire.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In this tutorial, you\u2019ve installed the Let\u2019s Encrypt client&nbsp;<code>certbot<\/code>, configured and installed an SSL certificate for your domain, and confirmed that Certbot\u2019s automatic renewal service is active within&nbsp;<code>systemctl<\/code>. If you have further questions about using Certbot,&nbsp;<a href=\"https:\/\/certbot.eff.org\/docs\/\">their documentation<\/a>&nbsp;is a good place to start.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uc0ac\uc6a9\uae30\uac04\uc774 \uc81c\ud55c\ub41c \ubb34\ub8cc \uc0c1\uc5c5\uc6a9 ssl \uc778\uc99d\uc11c\ub97c \uc0ac\uc6a9\ud558\uac70\ub098 Self \uc778\uc99d\uc11c\ub97c \uc0ac\uc6a9\ud558\uc5ec \ubcf4\uc558\uc9c0\ub9cc \ubb34\ub8cc \uae30\uac04\uc774 \uc9c0\ub098\uba74 \uc0ac\uc6a9\ud558\uc9c0 \ubabb\ud558\uace0 \uc0ac\uc124 \uc778\uc99d\uc11c\ub294 \ube0c\ub77c\uc6b0\uc800\uc5d0\uc11c \uc81c\ub300\ub85c \uc0ac\uc6a9\ud558\uae30\uac00 \uc5b4\ub824\uc6e0\ub2e4. \ud574\uacb0 \ubc29\ubc95\uc744 \ucc3e\ub2e4\uac00 CertBot\uc744 \uc774\uc6a9\ud558\uc5ec \uc790\ub3d9\uc73c\ub85c \uac31\uc2e0\uae4c\uc9c0 \ud574\uc900\ub2e4\ub294 \ub0b4\uc6a9\uc744 \ubcf4\uace0 \uc801\uc6a9\ud574\ubcf4\uc558\ub2e4. \uadf8\ub7f0\ub370 \ub73b\ubc16\uc5d0\ub3c4 \ud06c\ub86c \ube0c\ub77c\uc6b0\uc800\uc5d0\uc11c \ubcc4\ub3c4\uc758 \uacbd\uace0 \uba54\uc2dc\uc9c0\ub3c4 &hellip; <a href=\"https:\/\/www.spacek.xyz\/mle\/?p=30\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[13,12,9],"class_list":["post-30","post","type-post","status-publish","format-standard","hentry","category-6","tag-certbot","tag-ssl","tag-ubuntu"],"views":6627,"_links":{"self":[{"href":"https:\/\/www.spacek.xyz\/mle\/index.php?rest_route=\/wp\/v2\/posts\/30","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.spacek.xyz\/mle\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.spacek.xyz\/mle\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.spacek.xyz\/mle\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.spacek.xyz\/mle\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=30"}],"version-history":[{"count":2,"href":"https:\/\/www.spacek.xyz\/mle\/index.php?rest_route=\/wp\/v2\/posts\/30\/revisions"}],"predecessor-version":[{"id":32,"href":"https:\/\/www.spacek.xyz\/mle\/index.php?rest_route=\/wp\/v2\/posts\/30\/revisions\/32"}],"wp:attachment":[{"href":"https:\/\/www.spacek.xyz\/mle\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=30"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.spacek.xyz\/mle\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=30"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.spacek.xyz\/mle\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=30"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}