{"id":313,"date":"2020-05-08T05:03:05","date_gmt":"2020-05-08T05:03:05","guid":{"rendered":"https:\/\/badasscybersecurity.com\/?p=313"},"modified":"2020-05-08T05:05:14","modified_gmt":"2020-05-08T05:05:14","slug":"https-with-lets-encrypt-on-ubuntu-16-04","status":"publish","type":"post","link":"https:\/\/badasscybersecurity.com\/?p=313","title":{"rendered":"HTTPS with Let&#8217;s Encrypt on Ubuntu 16.04"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Step 1 <\/h2>\n\n\n\n<p>Before starting work on this task, I assume you already have:<\/p>\n\n\n\n<ul><li>Running Ubuntu system with sudo privileges shell access.<\/li><li>A domain name registered and pointed to your server\u2019s public IP address. For this tutorial, we use example.com and www.example.com, which is pointed to our server.<\/li><li>Running Apache2 server with VirtualHost configured for example.com and www.example.com for Port 80.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2 \u2013 Install Let\u2019s Encrypt Client<\/h2>\n\n\n\n<p>You can download the&nbsp;<code>certbot-auto<\/code>&nbsp;Let\u2019s Encrypt client and save it in&nbsp;<code>\/usr\/sbin<\/code>&nbsp;directory. Use the following command to do it.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo wget https:\/\/dl.eff.org\/certbot-auto -O \/usr\/sbin\/certbot-auto\nsudo chmod a+x \/usr\/sbin\/certbot-auto\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3 \u2013 Issue SSL from Let\u2019s Encrypt<\/h2>\n\n\n\n<p>Let\u2019s Encrypt performs Domain Validation (DV) automatically with multiple challenges. Once the Certificate Authority (CA) verified the authenticity of your domain, SSL certificate will be issued.<\/p>\n\n\n\n<p>You don\u2019t need to create VirtualHost for SSL\/HTTPS, Let\u2019s encrypt will create it. You only need to create VirtualHost for port 80 only.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo certbot-auto --apache -d example.com  -d www.example.com\n<\/pre>\n\n\n\n<p>Above command will prompt for an email address, which is used for sending email alerts related to SSL renewal and expiration. Also, asks a few more questions. After completion, it will issue an SSL certificate and will also create a new VirtualHost configuration file on your system.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4 \u2013 Configure SSL Auto Renew<\/h2>\n\n\n\n<p>At the end, configure the following job on your server crontab to auto-renew SSL certificate if required.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">0 2 * * * sudo certbot-auto -q renew<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Step 1 Before starting work on this task, I assume you already have: Running Ubuntu system with sudo privileges shell access. A domain name registered and pointed to your server\u2019s public IP address. For this tutorial, we use example.com and www.example.com, which is pointed to our server. Running Apache2 server with VirtualHost configured for example.com [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":314,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":""},"categories":[4],"tags":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/badasscybersecurity.com\/wp-content\/uploads\/2020\/05\/ubuntuletsencrypt.png?fit=318%2C159&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pae4MQ-53","_links":{"self":[{"href":"https:\/\/badasscybersecurity.com\/index.php?rest_route=\/wp\/v2\/posts\/313"}],"collection":[{"href":"https:\/\/badasscybersecurity.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/badasscybersecurity.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/badasscybersecurity.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/badasscybersecurity.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=313"}],"version-history":[{"count":1,"href":"https:\/\/badasscybersecurity.com\/index.php?rest_route=\/wp\/v2\/posts\/313\/revisions"}],"predecessor-version":[{"id":315,"href":"https:\/\/badasscybersecurity.com\/index.php?rest_route=\/wp\/v2\/posts\/313\/revisions\/315"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/badasscybersecurity.com\/index.php?rest_route=\/wp\/v2\/media\/314"}],"wp:attachment":[{"href":"https:\/\/badasscybersecurity.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/badasscybersecurity.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/badasscybersecurity.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}