{"id":4148,"date":"2020-03-12T00:11:04","date_gmt":"2020-03-12T00:11:04","guid":{"rendered":"https:\/\/lamp.ciscoar.com\/?page_id=4148"},"modified":"2020-03-15T01:48:57","modified_gmt":"2020-03-15T01:48:57","slug":"getting-ssl-certificates-with-certbot","status":"publish","type":"page","link":"https:\/\/lamp.ciscoar.com\/?page_id=4148","title":{"rendered":"Getting SSL certificates with Certbot"},"content":{"rendered":"\n\n\n<h2 class=\"wp-block-heading\">Let&#8217;s encrypt SSL certificates<\/h2>\n\n\n\n<p>Certbot will install free SSL certificates provided by Let&#8217;s encrypt and it will also configure Apache related files, all of that automatically by just running the following CLI command, of course first of all you must install certbot, take a look at <a rel=\"noreferrer noopener\" aria-label=\"this article (opens in a new tab)\" href=\"\/certbot\/\" target=\"_blank\">this article<\/a> to learn how to install certbot on your Linux CentOS 7.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"vim\" class=\"language-vim\">certbot --apache<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p>We&#8217;ve already mention that the main prerequisite is to have a live website, certbot will check that your website actually has a valid domain name, in case your website have <strong>subdomains <\/strong>the bot will also get certificates for them.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/03\/list-of-subdomains-apache-centos7.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"581\" height=\"361\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/03\/list-of-subdomains-apache-centos7.jpg\" alt=\"\" class=\"wp-image-4150\" srcset=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/03\/list-of-subdomains-apache-centos7.jpg 581w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/03\/list-of-subdomains-apache-centos7-300x186.jpg 300w\" sizes=\"auto, (max-width: 581px) 100vw, 581px\" \/><\/a><figcaption>Website subdomains &#8211; Apache CentOS 7<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Running Certbot on a LAB<\/h2>\n\n\n\n<p>I&#8217;m going to show you the first part on my LAB, and the <a href=\"\/certbot-in-action\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"second part (opens in a new tab)\">second part<\/a> on a real website.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"504\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/03\/running-certbot.gif\" alt=\"\" class=\"wp-image-4162\"\/><\/figure><\/div>\n\n\n\n<p>The next step can not be completed on a LAB environment because Certbot will live check your website domain and also its subdomains.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Certbot log<\/h2>\n\n\n\n<p>Here you can see the log produced by running certbot on a LAB and cancelling before starting the domain part.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"vim\" class=\"language-vim\">[root@centos7 ~]# certbot --apache\nSaving 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): pepe@argento.com\nStarting new HTTPS connection (1): acme-v02.api.letsencrypt.org\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\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\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\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\nWhich names would you like to activate HTTPS for?\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n1: centos7.local.lab\n2: java.centos7.local.lab\n3: www.java.centos7.local.lab\n4: lamp.centos7.local.lab\n5: www.lamp.centos7.local.lab\n6: php.centos7.local.lab\n7: www.php.centos7.local.lab\n8: www.centos7.local.lab\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nSelect the appropriate numbers separated by commas and\/or spaces, or leave input\nblank to select all options shown (Enter 'c' to cancel): c\nPlease specify --domains, or --installer that will help in domain names autodiscovery, or --cert-name for an existing certificate name.\n\nIMPORTANT NOTES:\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<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">How Certbot works?<\/h2>\n\n\n\n<p>Certbot will first search on your server for domain and subdomains, then it  will present a list of domains and subdomains found on your server and you have to choose for which of them you want to get the certificates.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/03\/list-of-subdomains-found-by-certbot.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"753\" height=\"263\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/03\/list-of-subdomains-found-by-certbot.jpg\" alt=\"\" class=\"wp-image-4208\" srcset=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/03\/list-of-subdomains-found-by-certbot.jpg 753w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/03\/list-of-subdomains-found-by-certbot-300x105.jpg 300w\" sizes=\"auto, (max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px\" \/><\/a><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Where to go next?<\/h2>\n\n\n\n<p>The next step cannot be performed on a LAB where the domain and subdomains are not really live and only exist on your LAB, the challenge part won&#8217;t pass and for that reason I&#8217;m going to show you the second part on a real website, see following article.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"\/certbot-in-action\/\">Certbot in action on a real life scenario<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s encrypt SSL certificates Certbot will install free SSL certificates provided by Let&#8217;s encrypt and it will also configure Apache related files, all of that automatically by just running the following CLI command, of course first of all you must install certbot, take a look at this article to learn how to install certbot on &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/lamp.ciscoar.com\/?page_id=4148\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Getting SSL certificates with Certbot&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-4148","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/pages\/4148","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4148"}],"version-history":[{"count":18,"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/pages\/4148\/revisions"}],"predecessor-version":[{"id":4315,"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/pages\/4148\/revisions\/4315"}],"wp:attachment":[{"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}