{"id":20,"date":"2016-01-13T07:23:49","date_gmt":"2016-01-13T07:23:49","guid":{"rendered":"https:\/\/www.hostingahead.com\/blog\/?p=20"},"modified":"2016-01-13T11:44:04","modified_gmt":"2016-01-13T11:44:04","slug":"how-to-install-ssl-certificate-on-centos","status":"publish","type":"post","link":"https:\/\/www.hostingahead.com\/blog\/how-to-install-ssl-certificate-on-centos\/","title":{"rendered":"How to install ssl certificate on centos"},"content":{"rendered":"<p><strong>SSL Certificate<\/strong><\/p>\n<p>A SSL certificate is a way to encrypt a site&#8217;s information and create a more secure connection. In order to install an SSL certificate you have to follow main four steps:<br \/>\n1) Create CSR and Private Key<br \/>\n2) Purchase an SSL certificate from a provider ( <a href=\"https:\/\/www.hostingahead.com\/cart?gid=6\" target=\"_blank\">you can purchase from here<\/a> )<br \/>\n3) Submit the CSR to the provider and they will email you the certificate<br \/>\n4) Add the certificate to the server<\/p>\n<p><strong>Step One: Install Mod SSL<\/strong><br \/>\nInstall apache SSL module and restart the apache service<br \/>\n<code>yum install mod_ssl<\/code><\/p>\n<p><code>service httpd restart<\/code><\/p>\n<p>If you use any firewall, please make sure the port 443 is opened.<\/p>\n<p><strong>Step Two :\u00a0 Generate the CSR and Private Key<\/strong><\/p>\n<p>Let&#8217;s create these files on a directory called \/etc\/httpd\/ssl ( you can store this anywhere on the server )<\/p>\n<p><code>mkdir \/etc\/httpd\/ssl<\/code><br \/>\n<code>cd \/etc\/httpd\/ssl<\/code><br \/>\n<code>openssl req -newkey rsa:2048 -nodes -keyout example.com.key -out example.com.csr<\/code><br \/>\nThis will ask you to enter few information and please provide accurate information. If there are any error , you can delete the two files example.com.key and example.com.csr and run the command again.<\/p>\n<p><strong>Step Three:\u00a0 Purchase an SSL certificate<br \/>\n<\/strong><\/p>\n<p>Purchase an SSL certificate from your desired provider and submit the generated CSR and the provider will email you an SSL certificate and intermediate certificate.<\/p>\n<p><strong>Step Four:\u00a0 Install the certificate<br \/>\n<\/strong><\/p>\n<p>Let&#8217;s keep the certificate and intermediate certificate in \/etc\/httpd\/ssl<\/p>\n<p>I assume that we have following files in \/etc\/httpd\/ssl<\/p>\n<p>example.com.key<br \/>\nexample.com.csr<br \/>\nexample.com.crt<br \/>\ninter-mediate-certificate.crt ( optional , but browsers may show warning if this is not installed on server )<\/p>\n<p>Now edit\u00a0 \/etc\/httpd\/conf\/ssl.conf and add below lines<\/p>\n<p><code>SSLEngine on<br \/>\nSSLCertificateFile \/etc\/httpd\/ssl\/example.com.crt<br \/>\nSSLCertificateKeyFile \/etc\/httpd\/ssl\/example.com.key<br \/>\nSSLCertificateChainFile \/etc\/httpd\/ssl\/inter-mediate-certificate.crt<\/code><\/p>\n<p>If you use many websites on your server, you can add this inside the virtual host<\/p>\n<p><code>&lt;VirtualHost *:443&gt;<br \/>\nServerName example.com<br \/>\nDocumentRoot \/home\/user\/public_html<br \/>\nSSLEngine on<br \/>\nSSLCertificateFile \/etc\/httpd\/ssl\/example.com.crt<br \/>\nSSLCertificateKeyFile \/etc\/httpd\/ssl\/example.com.key<br \/>\nSSLCertificateChainFile \/etc\/httpd\/ssl\/inter-mediate-certificate.crt<br \/>\n&lt;\/VirtualHost&gt;<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>SSL Certificate A SSL certificate is a way to encrypt a site&#8217;s information and create a more secure connection. In order to install an SSL certificate you have to follow main four steps: 1) Create CSR and Private Key 2) Purchase an SSL certificate from a provider ( you can purchase from here ) 3) &#8230;<\/p>\n","protected":false},"author":101012,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/posts\/20"}],"collection":[{"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/users\/101012"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/comments?post=20"}],"version-history":[{"count":3,"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/posts\/20\/revisions"}],"predecessor-version":[{"id":24,"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/posts\/20\/revisions\/24"}],"wp:attachment":[{"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/media?parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/categories?post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/tags?post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}