{"id":278,"date":"2022-07-18T17:23:13","date_gmt":"2022-07-18T17:23:13","guid":{"rendered":"https:\/\/www.webhi.com\/how-to\/?p=278"},"modified":"2022-07-21T09:15:15","modified_gmt":"2022-07-21T09:15:15","slug":"how-to-install-ssl-certificate-on-apache-for-centos-7","status":"publish","type":"post","link":"https:\/\/www.webhi.com\/how-to\/how-to-install-ssl-certificate-on-apache-for-centos-7\/","title":{"rendered":"How To Install SSL Certificate on Apache for CentOS 7"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/ssl_apache_centos.jpg\" alt=\"Install SSL Certificate on Apache\" class=\"wp-image-800\" srcset=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/ssl_apache_centos.jpg 1200w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/ssl_apache_centos-300x169.jpg 300w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/ssl_apache_centos-1024x576.jpg 1024w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/ssl_apache_centos-768x432.jpg 768w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/ssl_apache_centos-150x84.jpg 150w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">1- <strong>Copy\/paste the Certificate files into your server.<\/strong><\/h3>\n\n\n\n<p>Download your SSL Certificate file from your Provider, then paste them into your server\u2019s directory where you will maintain your certificate and key files. Make them possible to read uniquely by root.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. Install Mod SSL<\/strong><\/h3>\n\n\n\n<p>To install mod_ssl you can <a href=\"https:\/\/www.webhi.com\/how-to\/how-to-install-mod_ssl-on-rhel-centos-7-with-apache-web-server\/\" target=\"_blank\" rel=\"noreferrer noopener\">check out our installation guide here<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. Set Up the Certificate<\/strong><\/h3>\n\n\n\n<p>Start by copying your certificate file in <kbd>\/etc\/ssl\/private<\/kbd><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ mkdir -p \/etc\/ssl\/private\n$ chmod 700 \/etc\/ssl\/private<\/code><\/pre>\n\n\n\n<p>Next is setting up the virtual hosts to showcase the new certificate.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">$ sudo vi \/etc\/httpd\/conf.d\/ssl.conf<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"apacheconf\" class=\"language-apacheconf\">&lt;VirtualHost *:<strong>443<\/strong>&gt;\nDocumentRoot \/var\/www\/html\nServerName www.example.com\n<strong>SSLEngine on\nSSLCertificateFile \/etc\/ssl\/private\/certificate.crt\nSSLCertificateKeyFile \/etc\/ssl\/private\/private.key<\/strong>\n&lt;\/VirtualHost&gt;<\/code><\/pre>\n\n\n\n<p>After these edits are completed, save and close the file.<\/p>\n\n\n\n<p>Adjust the file names for them to go with your certificate files:<\/p>\n\n\n\n<ul><li>\u201c<kbd>SSLCertificateFile<\/kbd>\u201d is supposed to be your certificate file (e.g., your_domain_name.crt).<\/li><li>\u201c<kbd>SSLCertificateKeyFile<\/kbd>\u201d is supposed to be the key file generated when you made the CSR.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4. Redirect to HTTPS<\/strong><\/h3>\n\n\n\n<p>To redirect traffic to become SSL encrypted, go ahead and open a file ending in <strong>.conf <\/strong>in the <kbd>\/etc\/httpd\/conf.d<\/kbd> directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo vi \/etc\/httpd\/conf\/httpd.conf<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"apacheconf\" class=\"language-apacheconf\">&lt;VirtualHost *:80&gt;\n        ServerName www.example.com\n        Redirect \"\/\" \"https:\/\/www.example.com\/\"\n&lt;\/VirtualHost&gt;<\/code><\/pre>\n\n\n\n<p>Once completed, save and close the file.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5. Verify the config of your Apache before&nbsp; you restart.<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ apachectl configtest<\/code><\/pre>\n\n\n\n<p><strong>Restart Apache.<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ systemctl restart httpd<\/code><\/pre>\n\n\n\n<p>You are now ready to use the SSL certificate along with your Apache-SSL server.<\/p>\n\n\n\n<p>Check out <strong><a href=\"https:\/\/www.webhi.com\/cheap-ssl-certificate\" target=\"_blank\" rel=\"noreferrer noopener\">our SSL certificates offers<\/a><\/strong>, you can get cheap SSL from all known SSL providers.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1- Copy\/paste the Certificate files into your server. Download your SSL Certificate file from your Provider, then paste them into your server\u2019s directory where you will maintain your certificate and key files. Make them possible to read uniquely by root. 2. Install Mod SSL To install mod_ssl you can check out our installation guide here. ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/www.webhi.com\/how-to\/how-to-install-ssl-certificate-on-apache-for-centos-7\/\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,4],"tags":[],"yoast_head":"\n<title>How To Install SSL Certificate on Apache for CentOS 7 - WebHi Tutorials &amp; Documentations<\/title>\n<meta name=\"description\" content=\"How To Install SSL Certificate on Apache to secure your website or web app for CentOS 7\" \/>\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.webhi.com\/how-to\/how-to-install-ssl-certificate-on-apache-for-centos-7\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Install SSL Certificate on Apache for CentOS 7 - WebHi Tutorials &amp; Documentations\" \/>\n<meta property=\"og:description\" content=\"How To Install SSL Certificate on Apache to secure your website or web app for CentOS 7\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webhi.com\/how-to\/how-to-install-ssl-certificate-on-apache-for-centos-7\/\" \/>\n<meta property=\"og:site_name\" content=\"WebHi Tutorials &amp; Documentations\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webhi.technology\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-18T17:23:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-07-21T09:15:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/ssl_apache_centos.jpg\" \/>\n<meta name=\"author\" content=\"webhi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@WebHiTechnology\" \/>\n<meta name=\"twitter:site\" content=\"@WebHiTechnology\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"webhi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-ssl-certificate-on-apache-for-centos-7\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-ssl-certificate-on-apache-for-centos-7\/\"},\"author\":{\"name\":\"webhi\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54\"},\"headline\":\"How To Install SSL Certificate on Apache for CentOS 7\",\"datePublished\":\"2022-07-18T17:23:13+00:00\",\"dateModified\":\"2022-07-21T09:15:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-ssl-certificate-on-apache-for-centos-7\/\"},\"wordCount\":217,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\"},\"articleSection\":[\"SSL Certificate\",\"Web servers\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webhi.com\/how-to\/how-to-install-ssl-certificate-on-apache-for-centos-7\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-ssl-certificate-on-apache-for-centos-7\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-ssl-certificate-on-apache-for-centos-7\/\",\"name\":\"How To Install SSL Certificate on Apache for CentOS 7 - WebHi Tutorials &amp; Documentations\",\"isPartOf\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#website\"},\"datePublished\":\"2022-07-18T17:23:13+00:00\",\"dateModified\":\"2022-07-21T09:15:15+00:00\",\"description\":\"How To Install SSL Certificate on Apache to secure your website or web app for CentOS 7\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-ssl-certificate-on-apache-for-centos-7\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webhi.com\/how-to\/how-to-install-ssl-certificate-on-apache-for-centos-7\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-ssl-certificate-on-apache-for-centos-7\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webhi.com\/how-to\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Install SSL Certificate on Apache for CentOS 7\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#website\",\"url\":\"https:\/\/www.webhi.com\/how-to\/\",\"name\":\"WebHi Tutorials &amp; Documentations\",\"description\":\"System administration and knowledge base\",\"publisher\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webhi.com\/how-to\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\",\"name\":\"WebHi Technology\",\"url\":\"https:\/\/www.webhi.com\/how-to\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png\",\"contentUrl\":\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png\",\"width\":288,\"height\":95,\"caption\":\"WebHi Technology\"},\"image\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webhi.technology\",\"https:\/\/twitter.com\/WebHiTechnology\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54\",\"name\":\"webhi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1783634435\",\"contentUrl\":\"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1783634435\",\"caption\":\"webhi\"},\"sameAs\":[\"https:\/\/www.webhi.com\/how-to\"],\"url\":\"https:\/\/www.webhi.com\/how-to\/author\/webhi\/\"}]}<\/script>\n","yoast_head_json":{"title":"How To Install SSL Certificate on Apache for CentOS 7 - WebHi Tutorials &amp; Documentations","description":"How To Install SSL Certificate on Apache to secure your website or web app for CentOS 7","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.webhi.com\/how-to\/how-to-install-ssl-certificate-on-apache-for-centos-7\/","og_locale":"en_US","og_type":"article","og_title":"How To Install SSL Certificate on Apache for CentOS 7 - WebHi Tutorials &amp; Documentations","og_description":"How To Install SSL Certificate on Apache to secure your website or web app for CentOS 7","og_url":"https:\/\/www.webhi.com\/how-to\/how-to-install-ssl-certificate-on-apache-for-centos-7\/","og_site_name":"WebHi Tutorials &amp; Documentations","article_publisher":"https:\/\/www.facebook.com\/webhi.technology","article_published_time":"2022-07-18T17:23:13+00:00","article_modified_time":"2022-07-21T09:15:15+00:00","og_image":[{"url":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/ssl_apache_centos.jpg"}],"author":"webhi","twitter_card":"summary_large_image","twitter_creator":"@WebHiTechnology","twitter_site":"@WebHiTechnology","twitter_misc":{"Written by":"webhi","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/www.webhi.com\/how-to\/how-to-install-ssl-certificate-on-apache-for-centos-7\/#article","isPartOf":{"@id":"https:\/\/www.webhi.com\/how-to\/how-to-install-ssl-certificate-on-apache-for-centos-7\/"},"author":{"name":"webhi","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54"},"headline":"How To Install SSL Certificate on Apache for CentOS 7","datePublished":"2022-07-18T17:23:13+00:00","dateModified":"2022-07-21T09:15:15+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webhi.com\/how-to\/how-to-install-ssl-certificate-on-apache-for-centos-7\/"},"wordCount":217,"commentCount":0,"publisher":{"@id":"https:\/\/www.webhi.com\/how-to\/#organization"},"articleSection":["SSL Certificate","Web servers"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webhi.com\/how-to\/how-to-install-ssl-certificate-on-apache-for-centos-7\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webhi.com\/how-to\/how-to-install-ssl-certificate-on-apache-for-centos-7\/","url":"https:\/\/www.webhi.com\/how-to\/how-to-install-ssl-certificate-on-apache-for-centos-7\/","name":"How To Install SSL Certificate on Apache for CentOS 7 - WebHi Tutorials &amp; Documentations","isPartOf":{"@id":"https:\/\/www.webhi.com\/how-to\/#website"},"datePublished":"2022-07-18T17:23:13+00:00","dateModified":"2022-07-21T09:15:15+00:00","description":"How To Install SSL Certificate on Apache to secure your website or web app for CentOS 7","breadcrumb":{"@id":"https:\/\/www.webhi.com\/how-to\/how-to-install-ssl-certificate-on-apache-for-centos-7\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webhi.com\/how-to\/how-to-install-ssl-certificate-on-apache-for-centos-7\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.webhi.com\/how-to\/how-to-install-ssl-certificate-on-apache-for-centos-7\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webhi.com\/how-to\/"},{"@type":"ListItem","position":2,"name":"How To Install SSL Certificate on Apache for CentOS 7"}]},{"@type":"WebSite","@id":"https:\/\/www.webhi.com\/how-to\/#website","url":"https:\/\/www.webhi.com\/how-to\/","name":"WebHi Tutorials &amp; Documentations","description":"System administration and knowledge base","publisher":{"@id":"https:\/\/www.webhi.com\/how-to\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webhi.com\/how-to\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webhi.com\/how-to\/#organization","name":"WebHi Technology","url":"https:\/\/www.webhi.com\/how-to\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/","url":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png","contentUrl":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png","width":288,"height":95,"caption":"WebHi Technology"},"image":{"@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webhi.technology","https:\/\/twitter.com\/WebHiTechnology"]},{"@type":"Person","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54","name":"webhi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/image\/","url":"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1783634435","contentUrl":"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1783634435","caption":"webhi"},"sameAs":["https:\/\/www.webhi.com\/how-to"],"url":"https:\/\/www.webhi.com\/how-to\/author\/webhi\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/278"}],"collection":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/comments?post=278"}],"version-history":[{"count":30,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/278\/revisions"}],"predecessor-version":[{"id":1401,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/278\/revisions\/1401"}],"wp:attachment":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/media?parent=278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/categories?post=278"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/tags?post=278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}