{"id":74,"date":"2020-07-20T14:48:48","date_gmt":"2020-07-20T12:48:48","guid":{"rendered":"http:\/\/www.spanidis.eu\/?p=74"},"modified":"2020-08-05T13:23:50","modified_gmt":"2020-08-05T11:23:50","slug":"create-ssl-for-website-in-apache-and-windows-server","status":"publish","type":"post","link":"http:\/\/www.spanidis.eu\/?p=74","title":{"rendered":"Create SSL Certificate for website in Apache 2.4 and Windows Server"},"content":{"rendered":"\n<p>You should follow the steps below to create an ssl certificate of Apache2.4 in Windows Server environment. <\/p>\n\n\n\n<p><strong>Creating the OpenSSL command<\/strong><br>The easiest way is to use the website of digicert to get the openssl command that generates the CSR file. <br><br>Digicert OpenSSL CSR Wizard: <a href=\"https:\/\/www.digicert.com\/easy-csr\/openssl.htm\">https:\/\/www.digicert.com\/easy-csr\/openssl.htm<\/a><br><br>An example of the wizard can be seen below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"796\" height=\"359\" src=\"http:\/\/www.spanidis.eu\/wp-content\/uploads\/testGRexample.png\" alt=\"\" class=\"wp-image-76\" srcset=\"http:\/\/www.spanidis.eu\/wp-content\/uploads\/testGRexample.png 796w, http:\/\/www.spanidis.eu\/wp-content\/uploads\/testGRexample-300x135.png 300w\" sizes=\"(max-width: 796px) 100vw, 796px\" \/><figcaption>Digicert OpenSSL CSR Wizard<\/figcaption><\/figure>\n\n\n\n<p>The command text of the example is the following.<br><em>openssl req -new -newkey rsa:2048 -nodes -out www_test_gr.csr -keyout www_test_gr.key -subj &#8220;\/C=GR\/ST=Macedonia\/L=Thessaloniki\/O=Test GR\/OU=Sub Test\/CN=www.test.gr&#8221;<\/em><br>You may modify the above command to get the OpenSSL command without the use of the wizard. <\/p>\n\n\n\n<p><strong>Get the CSR and KEY files<\/strong><br>Open a command line and navigate to the bin folder of the Apache installation. It is where the <strong>openssl.exe<\/strong> file resides. <br><br>You should copy the above command (&#8220;openssl&#8221;) and paste it into the command line window. You should get two files, the CSR and the KEY files.  <\/p>\n\n\n\n<p><strong>Get the Certificate<\/strong><br>Use the CSR content to create the CER or CRT file from your Certificate provider.<\/p>\n\n\n\n<p><strong>Add the Certificate into the httpd.conf file of Apache<\/strong><br>Open the httpd.conf file and add the following virtualhost<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"784\" height=\"208\" src=\"http:\/\/www.spanidis.eu\/wp-content\/uploads\/virtualhost.png\" alt=\"\" class=\"wp-image-79\" srcset=\"http:\/\/www.spanidis.eu\/wp-content\/uploads\/virtualhost.png 784w, http:\/\/www.spanidis.eu\/wp-content\/uploads\/virtualhost-300x80.png 300w\" sizes=\"(max-width: 784px) 100vw, 784px\" \/><figcaption>VirtualHost SSL<\/figcaption><\/figure>\n\n\n\n<p>ServerName www.test.gr<br>ServerAlias test.gr<br>SSLEngine on<br>SSLCertificateFile &#8220;C:\/Apache24\/FolderOfSSLfile\/test_gr_cert.cer&#8221;<br>SSLCertificateKeyFile &#8220;C:\/Apache24\/FolderOfSSLfile\/test_gr.key&#8221;<br>SSLCertificateChainFile &#8220;C:\/Apache24\/FolderOfSSLfile\/test_gr.csr&#8221;<\/p>\n\n\n\n<p>Do not forget to redirect the insecure site to the secure one.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"540\" height=\"94\" src=\"http:\/\/www.spanidis.eu\/wp-content\/uploads\/virtualhost2.png\" alt=\"\" class=\"wp-image-81\" srcset=\"http:\/\/www.spanidis.eu\/wp-content\/uploads\/virtualhost2.png 540w, http:\/\/www.spanidis.eu\/wp-content\/uploads\/virtualhost2-300x52.png 300w\" sizes=\"(max-width: 540px) 100vw, 540px\" \/><figcaption>VirtualHost &#8211; Redirection<\/figcaption><\/figure>\n\n\n\n<p>ServerName www.test.gr <br>ServerAlias test.gr *.test.gr <br>Redirect &#8220;\/&#8221; &#8220;https:\/\/www.test.gr\/&#8221;<\/p>\n\n\n\n<p>(the virtual host redirection should be above the virstual host SSL)<\/p>\n\n\n\n<p>Best regards<br>Pavlos<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You should follow the steps below to create an ssl certificate of Apache2.4 in Windows Server environment. Creating the OpenSSL commandThe easiest way is to use the website of digicert to get the openssl command that generates the CSR file. Digicert OpenSSL CSR Wizard: https:\/\/www.digicert.com\/easy-csr\/openssl.htm An example of the wizard can be seen below. The &hellip; <a href=\"http:\/\/www.spanidis.eu\/?p=74\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Create SSL Certificate for website in Apache 2.4 and Windows Server<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[22,21,26,25,27],"_links":{"self":[{"href":"http:\/\/www.spanidis.eu\/index.php?rest_route=\/wp\/v2\/posts\/74"}],"collection":[{"href":"http:\/\/www.spanidis.eu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.spanidis.eu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.spanidis.eu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.spanidis.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=74"}],"version-history":[{"count":10,"href":"http:\/\/www.spanidis.eu\/index.php?rest_route=\/wp\/v2\/posts\/74\/revisions"}],"predecessor-version":[{"id":99,"href":"http:\/\/www.spanidis.eu\/index.php?rest_route=\/wp\/v2\/posts\/74\/revisions\/99"}],"wp:attachment":[{"href":"http:\/\/www.spanidis.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=74"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.spanidis.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=74"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.spanidis.eu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=74"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}