{"id":2626,"date":"2019-06-23T08:19:00","date_gmt":"2019-06-23T02:49:00","guid":{"rendered":"https:\/\/www.24x7serversupport.com\/blog\/?p=2626"},"modified":"2019-06-23T08:47:40","modified_gmt":"2019-06-23T03:17:40","slug":"how-to-install-lets-encrypt-on-centos-7-with-apache","status":"publish","type":"post","link":"https:\/\/www.24x7serversupport.com\/blog\/how-to-install-lets-encrypt-on-centos-7-with-apache\/","title":{"rendered":"How to install Let\u2019s Encrypt on CentOS 7 with Apache"},"content":{"rendered":"\n<p>Let\u2019s Encrypt is a free, automated, and open certificate authority (CA), run for the public\u2019s benefit. It is a service provided by the&nbsp;<a href=\"https:\/\/www.abetterinternet.org\/\">Internet Security Research Group (ISRG)<\/a>. <\/p>\n\n\n\n<p>Let\u2019s Encrypt provides free, automatic and secure certificates. The website owners can easily obtain security certificates within minutes, enabling a safer web experience for all. <\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Update the System<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"># yum -y update<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Install dependent modules<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"># yum install -y epel-release mod_ssl<\/pre>\n\n\n\n<p>You will also need to have Apache installed and running.  <\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Install Let&#8217;s Encrypt Client<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"># yum install certbot python2-certbot-apache <\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Obtaining a Certificate<\/h4>\n\n\n\n<p>Certbot will handle SSL certificate management quite easily. It will generate a new certificate for the provided domain as a parameter.<br>For instance, we will use testdomain.com to which SSL certificate will be installed:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># certbot --apache -d testdomain.com <\/pre>\n\n\n\n<p>To generate SSL for multiple Domains and Sub domains, use below command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># certbot --apache -d testdomain.com -d www.testdomain.com <\/pre>\n\n\n\n<p>The&nbsp;<code>certbot<\/code>&nbsp;utility can also prompt you for domain information during the certificate request procedure.<\/p>\n\n\n\n<p>The program will present you with a step-by-step guide to customize your certificate options. It will ask you to provide an email address for lost key recovery and notices, and then prompt you to agree to the terms of service. If you did not specify your domains on the command line, you will be prompted for that as well. <\/p>\n\n\n\n<p>You will also be able to choose between enabling both http and https access or forcing all requests to redirect to https.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">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):<strong>2<\/strong><\/pre>\n\n\n\n<p>When the installation is complete, you will receive a similar message:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">IMPORTANT NOTES:\n- Congratulations! Your certificate and chain have been saved at:\n  \/etc\/letsencrypt\/live\/testdomain.com\/fullchain.pem\n  Your key file has been saved at:\n  \/etc\/letsencrypt\/live\/testdomain.com\/privkey.pem\n  Your cert will expire on 2019-09-23. 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 <em>all<\/em> of\n  your certificates, run \"certbot renew\"\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 <\/pre>\n\n\n\n<p>The generated certificate files will be available within a subdirectory named after your base domain in the \/etc\/letsencrypt\/live directory.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Configuring automatic certificate renewal<\/h4>\n\n\n\n<p>Let&#8217;s encrypt certificates are valid for 90 days. It is recommended to renew it within 60 days, in order to avoid any problems. To achieve this, certbot will assist us with your renewal command. It will verify that the certificate is less than 30 days from expiration: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># certbot renew<\/pre>\n\n\n\n<p>If the installed certificate is recent, certbot will only verify its expiration date:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Processing  \/etc\/letsencrypt\/renewal\/testdomain.com.conf\nThe following certs are not due for renewal yet:\n    \/etc\/letsencrypt\/live\/testdomain.com\/fullchain.pem (skipped)\nNo renewals were attempted.<\/pre>\n\n\n\n<p>To automate this renewal process, you can set up a cronjob :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># crontab -e<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">* *\/12 * * * \/usr\/bin\/certbot renew &gt;\/dev\/null 2&gt;&amp;1<\/pre>\n\n\n\n<p>Now you should have successfully installed and configured Let\u2019s Encrypt with Apache.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let\u2019s Encrypt is a free, automated, and open certificate authority (CA), run for the public\u2019s benefit. It is a service provided by the&nbsp;Internet Security Research Group (ISRG). Let\u2019s Encrypt provides free, automatic and secure certificates. The website owners can easily obtain security certificates within minutes, enabling a safer web experience for all. Update the System [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[30,34],"tags":[74,171,168],"class_list":["post-2626","post","type-post","status-publish","format-standard","hentry","category-centos","category-linux","tag-centos7","tag-certbot","tag-lets-encrypt"],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to install Let\u2019s Encrypt on CentOS 7 with Apache | 24x7serversupport Blog<\/title>\n<meta name=\"description\" content=\"How to install Let\u2019s Encrypt on CentOS 7 with Apache\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.24x7serversupport.com\/blog\/how-to-install-lets-encrypt-on-centos-7-with-apache\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to install Let\u2019s Encrypt on CentOS 7 with Apache | 24x7serversupport Blog\" \/>\n<meta property=\"og:description\" content=\"How to install Let\u2019s Encrypt on CentOS 7 with Apache\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.24x7serversupport.com\/blog\/how-to-install-lets-encrypt-on-centos-7-with-apache\/\" \/>\n<meta property=\"og:site_name\" content=\"24x7serversupport Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-06-23T02:49:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-06-23T03:17:40+00:00\" \/>\n<meta name=\"author\" content=\"24x7support\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@24x7serversuppo\" \/>\n<meta name=\"twitter:site\" content=\"@24x7serversuppo\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"24x7support\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/how-to-install-lets-encrypt-on-centos-7-with-apache\/\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/how-to-install-lets-encrypt-on-centos-7-with-apache\/\",\"name\":\"How to install Let\u2019s Encrypt on CentOS 7 with Apache | 24x7serversupport Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#website\"},\"datePublished\":\"2019-06-23T02:49:00+00:00\",\"dateModified\":\"2019-06-23T03:17:40+00:00\",\"author\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401\"},\"description\":\"How to install Let\u2019s Encrypt on CentOS 7 with Apache\",\"breadcrumb\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/how-to-install-lets-encrypt-on-centos-7-with-apache\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.24x7serversupport.com\/blog\/how-to-install-lets-encrypt-on-centos-7-with-apache\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/how-to-install-lets-encrypt-on-centos-7-with-apache\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.24x7serversupport.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to install Let\u2019s Encrypt on CentOS 7 with Apache\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#website\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/\",\"name\":\"24x7serversupport Blog\",\"description\":\"Linux | CPanel | WHM | webhosting| Plesk | DirectAdmin | CentOs | Debian | Ubuntu Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.24x7serversupport.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401\",\"name\":\"24x7support\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/author\/24x7support\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to install Let\u2019s Encrypt on CentOS 7 with Apache | 24x7serversupport Blog","description":"How to install Let\u2019s Encrypt on CentOS 7 with Apache","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.24x7serversupport.com\/blog\/how-to-install-lets-encrypt-on-centos-7-with-apache\/","og_locale":"en_US","og_type":"article","og_title":"How to install Let\u2019s Encrypt on CentOS 7 with Apache | 24x7serversupport Blog","og_description":"How to install Let\u2019s Encrypt on CentOS 7 with Apache","og_url":"https:\/\/www.24x7serversupport.com\/blog\/how-to-install-lets-encrypt-on-centos-7-with-apache\/","og_site_name":"24x7serversupport Blog","article_published_time":"2019-06-23T02:49:00+00:00","article_modified_time":"2019-06-23T03:17:40+00:00","author":"24x7support","twitter_card":"summary_large_image","twitter_creator":"@24x7serversuppo","twitter_site":"@24x7serversuppo","twitter_misc":{"Written by":"24x7support","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.24x7serversupport.com\/blog\/how-to-install-lets-encrypt-on-centos-7-with-apache\/","url":"https:\/\/www.24x7serversupport.com\/blog\/how-to-install-lets-encrypt-on-centos-7-with-apache\/","name":"How to install Let\u2019s Encrypt on CentOS 7 with Apache | 24x7serversupport Blog","isPartOf":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/#website"},"datePublished":"2019-06-23T02:49:00+00:00","dateModified":"2019-06-23T03:17:40+00:00","author":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401"},"description":"How to install Let\u2019s Encrypt on CentOS 7 with Apache","breadcrumb":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/how-to-install-lets-encrypt-on-centos-7-with-apache\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.24x7serversupport.com\/blog\/how-to-install-lets-encrypt-on-centos-7-with-apache\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.24x7serversupport.com\/blog\/how-to-install-lets-encrypt-on-centos-7-with-apache\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.24x7serversupport.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to install Let\u2019s Encrypt on CentOS 7 with Apache"}]},{"@type":"WebSite","@id":"https:\/\/www.24x7serversupport.com\/blog\/#website","url":"https:\/\/www.24x7serversupport.com\/blog\/","name":"24x7serversupport Blog","description":"Linux | CPanel | WHM | webhosting| Plesk | DirectAdmin | CentOs | Debian | Ubuntu Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.24x7serversupport.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401","name":"24x7support","url":"https:\/\/www.24x7serversupport.com\/blog\/author\/24x7support\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/2626","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/comments?post=2626"}],"version-history":[{"count":2,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/2626\/revisions"}],"predecessor-version":[{"id":2629,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/2626\/revisions\/2629"}],"wp:attachment":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/media?parent=2626"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/categories?post=2626"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/tags?post=2626"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}