{"id":1019,"date":"2014-04-20T16:33:03","date_gmt":"2014-04-20T16:33:03","guid":{"rendered":"http:\/\/scunster.co.uk\/?p=1019"},"modified":"2014-04-20T16:33:09","modified_gmt":"2014-04-20T16:33:09","slug":"enable-ssl-for-apache-and-create-self-signed-certificate-centos-6-5","status":"publish","type":"post","link":"https:\/\/scunster.co.uk\/?p=1019","title":{"rendered":"Enable SSL for apache and create self signed certificate (CentOS 6.5)"},"content":{"rendered":"<p>First, install mod_ssl and openssl. All of the commands will need to be run as root or su<\/p>\n<pre>yum install mod_ssl openssl<\/pre>\n<p>Now we generate the self signed certificate<\/p>\n<pre>openssl genrsa -out ca.key 2048 <\/pre>\n<pre>openssl req -new -key ca.key -out ca.csr<\/pre>\n<pre>openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt<\/pre>\n<pre>cp ca.crt \/etc\/pki\/tls\/certs\r\ncp ca.key \/etc\/pki\/tls\/private\/ca.key\r\ncp ca.csr \/etc\/pki\/tls\/private\/ca.csr<\/pre>\n<p>Now we need to update apache to use ssl<\/p>\n<pre>vi +\/SSLCertificateFile \/etc\/httpd\/conf.d\/ssl.conf<\/pre>\n<p>Make sure the SSL key paths are correct, if you&#8217;ve saved them to the same location as above the lines would need to be<\/p>\n<pre>SSLCertificateFile \/etc\/pki\/tls\/certs\/ca.crt<\/pre>\n<p>and just below that line<\/p>\n<pre>SSLCertificateKeyFile \/etc\/pki\/tls\/private\/ca.key<\/pre>\n<p>Save and quit vi with :w:q<\/p>\n<p>Now restart apache<\/p>\n<pre>\/etc\/init.d\/httpd restart<\/pre>\n<p>Don&#8217;t forget to add port 443 through your firewall and router!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>First, install mod_ssl and openssl. All of the commands will need to be run as root or su yum install mod_ssl openssl Now we generate the self signed certificate openssl genrsa -out ca.key 2048 openssl req -new -key ca.key -out ca.csr openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt cp ca.crt \/etc\/pki\/tls\/certs [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[164,3,12],"tags":[],"class_list":["post-1019","post","type-post","status-publish","format-standard","hentry","category-centos","category-linux","category-webhosting"],"_links":{"self":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1019","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1019"}],"version-history":[{"count":2,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1019\/revisions"}],"predecessor-version":[{"id":1021,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1019\/revisions\/1021"}],"wp:attachment":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1019"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1019"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1019"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}