{"id":7720,"date":"2020-02-26T16:13:04","date_gmt":"2020-02-26T13:13:04","guid":{"rendered":"http:\/\/unihost.com\/help\/?p=7720"},"modified":"2023-10-06T16:02:14","modified_gmt":"2023-10-06T13:02:14","slug":"apache-with-lets-encrypt-certificates-on-centos-8","status":"publish","type":"post","link":"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/","title":{"rendered":"How to secure Apache with Let\u2019s Encrypt on CentOS 8"},"content":{"rendered":"<p><span style=\"font-family: arial, helvetica, sans-serif;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/unihost.com\/help\/minio.php?le-logo-wide.png\" alt=\"Let's Encrypt\" width=\"1335\" height=\"393\" title=\"How to secure Apache with Let\u2019s Encrypt on CentOS 8 - Image 1\"><\/span><br \/>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Let&#8217;s Encrypt is a non-profit certificate authority run by Internet Security Research Group (ISRG) that provides X.509 certificates for Transport Layer Security (TLS) encryption at no charge.<!--more--> The certificate is valid for 90 days, during which renewal can take place at any time. The offer is accompanied by an automated process designed to overcome manual creation, validation, signing, installation, and renewal of certificates for secure websites. It launched on April 12, 2016.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">In this article, we will show you how you can install Let\u2019s Encrypt Certificate&nbsp;for&nbsp;Apache web server and configure the certificate to renew automatically on CentOS 8.<\/span><\/p>\n<h2 style=\"text-align: center;\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Installing Apache<\/span><\/h2>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Apache is available in the default CentOS repositories.<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># dnf install httpd&nbsp;mod_ssl<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Enable and start the Apache service.<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># systemctl enable httpd<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># systemctl start httpd<\/span><\/pre>\n<h2 style=\"text-align: center;\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Install Certbot<\/span><\/h2>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># wget https:\/\/dl.eff.org\/certbot-auto<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># mv certbot-auto \/usr\/local\/bin\/certbot-auto<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># chmod 0755 \/usr\/local\/bin\/certbot-auto<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Generate a new set of 2048 bit DH parameters to strengthen the security.<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># openssl dhparam -out \/etc\/ssl\/certs\/dhparam.pem 2048<\/span><\/pre>\n<h2 id=\"obtaining-a-lets-encrypt-ssl-certificate\" style=\"text-align: center;\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Obtaining a Let\u2019s Encrypt SSL certificate<\/span><\/h2>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">To obtain an SSL certificate for the domain we\u2019re going to use the Webroot plugin that works by creating a temporary file for validating the requested domain in the&nbsp;<em>${webroot-path}\/.well-known\/acme-challenge<\/em>&nbsp;directory. The Let\u2019s Encrypt server makes HTTP requests to the temporary file to validate that the requested domain resolves to the server where certbot runs.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">To make the setup more simple we\u2019re going to map all HTTP requests for&nbsp;<em>.well-known\/acme-challenge<\/em>&nbsp;to a single directory,&nbsp;<em>\/var\/lib\/letsencrypt.<\/em><\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># mkdir -p \/var\/lib\/letsencrypt\/.well-known<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># chgrp apache \/var\/lib\/letsencrypt<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># chmod g+s \/var\/lib\/letsencrypt<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Create two configurations files<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">#&nbsp; nano \/etc\/httpd\/conf.d\/letsencrypt.conf\n\nAlias \/.well-known\/acme-challenge\/ \"\/var\/lib\/letsencrypt\/.well-known\/acme-challenge\/\"\n&lt;Directory \"\/var\/lib\/letsencrypt\/\"&gt;\n    AllowOverride None\n    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec\n    Require method GET POST OPTIONS\n&lt;\/Directory&gt;<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">And the second one.<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># nano \/etc\/httpd\/conf.d\/ssl-params.conf\n\nSSLCipherSuite EECDH+AESGCM:EDH+AESGCM\n# Requires Apache 2.4.36 &amp; OpenSSL 1.1.1\nSSLProtocol -all +TLSv1.3 +TLSv1.2\nSSLOpenSSLConfCmd Curves X25519:secp521r1:secp384r1:prime256v1\n# Older versions\n# SSLProtocol All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1\nSSLHonorCipherOrder On\nHeader always set Strict-Transport-Security \"max-age=63072000; includeSubDomains; preload\"\nHeader always set X-Frame-Options DENY\nHeader always set X-Content-Type-Options nosniff\n# Requires Apache &gt;= 2.4\nSSLCompression off\nSSLUseStapling on\nSSLStaplingCache \"shmcb:logs\/stapling-cache(150000)\"\n# Requires Apache &gt;= 2.4.11\nSSLSessionTickets Off\n\nSSLOpenSSLConfCmd DHParameters \"\/etc\/ssl\/certs\/dhparam.pem\"<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Reload the Apache configuration<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># systemctl reload httpd<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Run certbot script with the webroot plugin and fetch the SSL certificate files.<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># \/usr\/local\/bin\/certbot-auto certonly --agree-tos --email admin@example.com --webroot -w \/var\/lib\/letsencrypt\/ -d example.com -d www.example.com<\/span><\/pre>\n<h2 style=\"text-align: center;\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Creating Virtual Host&nbsp;<\/span><\/h2>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">By default, Apache is configured to load all configuration files that ends with .<em>conf<\/em> from the <em>\/etc\/httpd\/conf.d\/<\/em> directory.<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># nano \/etc\/httpd\/conf.d\/example.com.conf<\/span>\n\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">&lt;VirtualHost *:80&gt;\n  ServerName example.com\n  ServerAlias www.example.com\n\n  Redirect permanent \/ https:\/\/example.com\/\n&lt;\/VirtualHost&gt;\n\n&lt;VirtualHost *:443&gt;\n  ServerName example.com\n  ServerAlias www.example.com\n\n  Protocols h2 http:\/1.1\n\n  &lt;If \"%{HTTP_HOST} == 'www.example.com'\"&gt;\n    Redirect permanent \/ https:\/\/example.com\/\n  &lt;\/If&gt;\n\n  DocumentRoot \/var\/www\/example.com\/public_html\n  ErrorLog \/var\/log\/httpd\/example.com-error.log\n  CustomLog \/var\/log\/httpd\/example.com-access.log combined\n\n  SSLEngine On\n  SSLCertificateFile \/etc\/letsencrypt\/live\/example.com\/fullchain.pem\n  SSLCertificateKeyFile \/etc\/letsencrypt\/live\/example.com\/privkey.pem\n\n&lt;\/VirtualHost&gt;<\/span><\/pre>\n<h2 style=\"text-align: center;\"><span id=\"Test_Lets_Encrypt_SSL_Certificate\" style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Test Let\u2019s Encrypt SSL Certificate<\/span><\/h2>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Test your SSL certificate for problems and its security ratings by going to the below URL.&nbsp;<\/span><br \/>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"><a href=\"https:\/\/www.ssllabs.com\/ssltest\" rel=\"nofollow nofollow noopener noreferrer\" target=\"_blank\">https:\/\/www.ssllabs.com\/ssltest<\/a><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/unihost.com\/help\/minio.php?DM_260220_jK0ZCk3R.png\" alt=\"Test Let\u2019s Encrypt SSL Certificate\" width=\"995\" height=\"473\" title=\"How to secure Apache with Let\u2019s Encrypt on CentOS 8 - Image 2\"><a href=\"https:\/\/www.sslshopper.com\/ssl-checker.html\" rel=\"nofollow nofollow noopener noreferrer\" target=\"_blank\">https:\/\/www.sslshopper.com\/ssl-checker.html<\/a><\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/unihost.com\/help\/minio.php?DM_260220_6okiS2Td.png\" alt=\"Renew Let\u2019s Encrypt Certificate\" width=\"733\" height=\"193\" title=\"How to secure Apache with Let\u2019s Encrypt on CentOS 8 - Image 3\"><\/span><\/p>\n<h2 style=\"text-align: center;\"><span id=\"Renew_Lets_Encrypt_Certificate\" style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Renew Let\u2019s Encrypt Certificate<\/span><\/h2>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Let\u2019s Encrypt certificate is valid for 90 days from the date of issuance, and it needs to be renewed before it expires.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Run the following command to create a new cronjob which will renew the certificate and restart Apache.<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># echo \"0 0,12 * * * root python3 -c 'import random; import time; time.sleep(random.random() * 3600)' &amp;&amp; \/usr\/local\/bin\/certbot-auto -q renew --renew-hook \\\"systemctl reload httpd\\\"\" | sudo tee -a \/etc\/crontab &gt; \/dev\/null<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">You can also simulate the certificate renewal process with the below command to ensure the renewal goes smooth.<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># \/usr\/local\/bin\/certbot-auto renew --dry-run<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">In this guide, we demonstrated how you can use&nbsp;certbot&nbsp;to install and configure the&nbsp;Let\u2019s Encrypt certificate&nbsp;on Apache webserver running on a&nbsp;CentOS 8&nbsp;system.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s Encrypt is a non-profit certificate authority run by Internet Security Research Group (ISRG) that provides X.509 certificates for Transport Layer Security (TLS) encryption at no charge.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[158],"tags":[123,58,544,548],"class_list":["post-7720","post","type-post","status-publish","format-standard","hentry","category-dedicated-servers","tag-apache","tag-centos","tag-httpd","tag-lets-encrypt"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to secure Apache with Let\u2019s Encrypt on CentOS 8 - Unihost.FAQ<\/title>\n<meta name=\"description\" content=\"\u2714 Installing Apache \u2714 Install Certbot \u2714 Obtaining a Let\u2019s Encrypt SSL certificate \u2714Creating Virtual Host \u2714 Test Let\u2019s Encrypt SSL\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to secure Apache with Let\u2019s Encrypt on CentOS 8 - Unihost.FAQ\" \/>\n<meta property=\"og:description\" content=\"\u2714 Installing Apache \u2714 Install Certbot \u2714 Obtaining a Let\u2019s Encrypt SSL certificate \u2714Creating Virtual Host \u2714 Test Let\u2019s Encrypt SSL\" \/>\n<meta property=\"og:url\" content=\"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/\" \/>\n<meta property=\"og:site_name\" content=\"Unihost.FAQ\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/unihost\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-02-26T13:13:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-06T13:02:14+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/unihost.com\/help\/wp-content\/uploads\/le-logo-wide.png\" \/>\n<meta name=\"author\" content=\"Unihost Support\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@unihost\" \/>\n<meta name=\"twitter:site\" content=\"@unihost\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Unihost Support\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/\"},\"author\":{\"name\":\"Unihost Support\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a\"},\"headline\":\"How to secure Apache with Let\u2019s Encrypt on CentOS 8\",\"datePublished\":\"2020-02-26T13:13:04+00:00\",\"dateModified\":\"2023-10-06T13:02:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/\"},\"wordCount\":414,\"publisher\":{\"@id\":\"https:\/\/unihost.com\/help\/#organization\"},\"image\":{\"@id\":\"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/unihost.com\/help\/wp-content\/uploads\/le-logo-wide.png\",\"keywords\":[\"Apache\",\"CentOS\",\"httpd\",\"let's encrypt\"],\"articleSection\":[\"02. Dedicated servers\"],\"inLanguage\":\"en\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/\",\"url\":\"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/\",\"name\":\"How to secure Apache with Let\u2019s Encrypt on CentOS 8 - Unihost.FAQ\",\"isPartOf\":{\"@id\":\"https:\/\/unihost.com\/help\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/unihost.com\/help\/wp-content\/uploads\/le-logo-wide.png\",\"datePublished\":\"2020-02-26T13:13:04+00:00\",\"dateModified\":\"2023-10-06T13:02:14+00:00\",\"description\":\"\u2714 Installing Apache \u2714 Install Certbot \u2714 Obtaining a Let\u2019s Encrypt SSL certificate \u2714Creating Virtual Host \u2714 Test Let\u2019s Encrypt SSL\",\"breadcrumb\":{\"@id\":\"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/#breadcrumb\"},\"inLanguage\":\"en\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/#primaryimage\",\"url\":\"https:\/\/unihost.com\/help\/minio.php?.\/le-logo-wide.png\",\"contentUrl\":\"https:\/\/unihost.com\/help\/minio.php?.\/le-logo-wide.png\",\"width\":1335,\"height\":393},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Unihost\",\"item\":\"https:\/\/unihost.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Help\",\"item\":\"https:\/\/unihost.com\/help\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to secure Apache with Let\u2019s Encrypt on CentOS 8\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/unihost.com\/help\/#website\",\"url\":\"https:\/\/unihost.com\/help\/\",\"name\":\"Unihost.FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/unihost.com\/help\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/unihost.com\/help\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/unihost.com\/help\/#organization\",\"name\":\"Unihost\",\"alternateName\":\"Unihost\",\"url\":\"https:\/\/unihost.com\/help\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png\",\"contentUrl\":\"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png\",\"width\":300,\"height\":300,\"caption\":\"Unihost\"},\"image\":{\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/unihost\/\",\"https:\/\/x.com\/unihost\",\"https:\/\/www.instagram.com\/unihost\/?hl=en\",\"https:\/\/www.linkedin.com\/company\/unihost-com\",\"https:\/\/www.youtube.com\/channel\/UCITKsxMDnslQY8brN3advgw\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a\",\"name\":\"Unihost Support\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g\",\"caption\":\"Unihost Support\"},\"sameAs\":[\"https:\/\/unihost.com\/\"],\"url\":\"https:\/\/unihost.com\/help\/author\/support\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to secure Apache with Let\u2019s Encrypt on CentOS 8 - Unihost.FAQ","description":"\u2714 Installing Apache \u2714 Install Certbot \u2714 Obtaining a Let\u2019s Encrypt SSL certificate \u2714Creating Virtual Host \u2714 Test Let\u2019s Encrypt SSL","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:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/","og_locale":"en_US","og_type":"article","og_title":"How to secure Apache with Let\u2019s Encrypt on CentOS 8 - Unihost.FAQ","og_description":"\u2714 Installing Apache \u2714 Install Certbot \u2714 Obtaining a Let\u2019s Encrypt SSL certificate \u2714Creating Virtual Host \u2714 Test Let\u2019s Encrypt SSL","og_url":"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/","og_site_name":"Unihost.FAQ","article_publisher":"https:\/\/www.facebook.com\/unihost\/","article_published_time":"2020-02-26T13:13:04+00:00","article_modified_time":"2023-10-06T13:02:14+00:00","og_image":[{"url":"http:\/\/unihost.com\/help\/wp-content\/uploads\/le-logo-wide.png","type":"","width":"","height":""}],"author":"Unihost Support","twitter_card":"summary_large_image","twitter_creator":"@unihost","twitter_site":"@unihost","twitter_misc":{"Written by":"Unihost Support","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/#article","isPartOf":{"@id":"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/"},"author":{"name":"Unihost Support","@id":"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a"},"headline":"How to secure Apache with Let\u2019s Encrypt on CentOS 8","datePublished":"2020-02-26T13:13:04+00:00","dateModified":"2023-10-06T13:02:14+00:00","mainEntityOfPage":{"@id":"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/"},"wordCount":414,"publisher":{"@id":"https:\/\/unihost.com\/help\/#organization"},"image":{"@id":"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/#primaryimage"},"thumbnailUrl":"http:\/\/unihost.com\/help\/wp-content\/uploads\/le-logo-wide.png","keywords":["Apache","CentOS","httpd","let's encrypt"],"articleSection":["02. Dedicated servers"],"inLanguage":"en"},{"@type":"WebPage","@id":"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/","url":"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/","name":"How to secure Apache with Let\u2019s Encrypt on CentOS 8 - Unihost.FAQ","isPartOf":{"@id":"https:\/\/unihost.com\/help\/#website"},"primaryImageOfPage":{"@id":"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/#primaryimage"},"image":{"@id":"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/#primaryimage"},"thumbnailUrl":"http:\/\/unihost.com\/help\/wp-content\/uploads\/le-logo-wide.png","datePublished":"2020-02-26T13:13:04+00:00","dateModified":"2023-10-06T13:02:14+00:00","description":"\u2714 Installing Apache \u2714 Install Certbot \u2714 Obtaining a Let\u2019s Encrypt SSL certificate \u2714Creating Virtual Host \u2714 Test Let\u2019s Encrypt SSL","breadcrumb":{"@id":"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/"]}]},{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/#primaryimage","url":"https:\/\/unihost.com\/help\/minio.php?.\/le-logo-wide.png","contentUrl":"https:\/\/unihost.com\/help\/minio.php?.\/le-logo-wide.png","width":1335,"height":393},{"@type":"BreadcrumbList","@id":"https:\/\/unihost.com\/help\/apache-with-lets-encrypt-certificates-on-centos-8\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Unihost","item":"https:\/\/unihost.com\/"},{"@type":"ListItem","position":2,"name":"Help","item":"https:\/\/unihost.com\/help\/"},{"@type":"ListItem","position":3,"name":"How to secure Apache with Let\u2019s Encrypt on CentOS 8"}]},{"@type":"WebSite","@id":"https:\/\/unihost.com\/help\/#website","url":"https:\/\/unihost.com\/help\/","name":"Unihost.FAQ","description":"","publisher":{"@id":"https:\/\/unihost.com\/help\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/unihost.com\/help\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":"Organization","@id":"https:\/\/unihost.com\/help\/#organization","name":"Unihost","alternateName":"Unihost","url":"https:\/\/unihost.com\/help\/","logo":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/","url":"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png","contentUrl":"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png","width":300,"height":300,"caption":"Unihost"},"image":{"@id":"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/unihost\/","https:\/\/x.com\/unihost","https:\/\/www.instagram.com\/unihost\/?hl=en","https:\/\/www.linkedin.com\/company\/unihost-com","https:\/\/www.youtube.com\/channel\/UCITKsxMDnslQY8brN3advgw"]},{"@type":"Person","@id":"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a","name":"Unihost Support","image":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/unihost.com\/help\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g","caption":"Unihost Support"},"sameAs":["https:\/\/unihost.com\/"],"url":"https:\/\/unihost.com\/help\/author\/support\/"}]}},"_links":{"self":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts\/7720","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/comments?post=7720"}],"version-history":[{"count":12,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts\/7720\/revisions"}],"predecessor-version":[{"id":16335,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts\/7720\/revisions\/16335"}],"wp:attachment":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/media?parent=7720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/categories?post=7720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/tags?post=7720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}