{"id":301,"date":"2021-05-06T10:42:29","date_gmt":"2021-05-06T10:42:29","guid":{"rendered":"http:\/\/symbioticindia.in\/docu\/?p=301"},"modified":"2021-05-06T10:42:29","modified_gmt":"2021-05-06T10:42:29","slug":"generating-self-signed-certificate-in-xampp-apache-web-server-windows-linux","status":"publish","type":"post","link":"http:\/\/symbioticindia.in\/docu\/2021\/05\/06\/generating-self-signed-certificate-in-xampp-apache-web-server-windows-linux\/","title":{"rendered":"Generating Self-Signed Certificate in XAMPP Apache Web Server [Windows\/Linux]"},"content":{"rendered":"\n<p>Below are the steps and additional information used to generate self-signed certificate and keys for Apache Web server in XAMPP for Win32 platform.<\/p>\n\n\n\n<p><strong>#Step 1: Generate a Private Key<\/strong><br>[root@localhost bin]#<strong><em>openssl genrsa -des3 -out server.key 1024&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/em><\/strong><br>Loading \u2018screen\u2019 into random state \u2013 done<br>Generating RSA private key, 1024 bit long modulus<br>\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026++++++<br>\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026++++++<br>e is 65537 (0\u00d710001)<br>Enter pass phrase for server.key: xxxxxxxx<br>Verifying \u2013 Enter pass phrase for server.key: xxxxxxxx<\/p>\n\n\n\n<p><strong>#Step 2: Generate a CSR (Certificate Signing Request)<\/strong><br>[root@localhost bin]# <strong><em>openssl req -new -key server.key -config <\/em>\u201c\/opt\/lampp\/etc\/openssl.cnf\u201d<\/strong><em><strong>\u201d<\/strong><\/em><strong><em> -out server.csr&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<\/em><\/strong><br>Enter pass phrase for server.key:&nbsp; xxxxxxxx<br>Loading \u2018screen\u2019 into random state \u2013 done<br>You are about to be asked to enter information that will be incorporated into your certificate request.<br>What you are about to enter is what is called a Distinguished Name or a DN.<br>There are quite a few fields but you can leave some blank<br>For some fields there will be a default value,<br>If you enter \u2018.\u2019, the field will be left blank.<br>\u2014\u2013<br>Country Name (2 letter code) [AU]: <strong>IN<\/strong><br>State or Province Name (full name) [Some-State]:<strong>CHD<\/strong><br>Locality Name (eg, city) []:<strong>CHD<\/strong><br>Organization Name (eg, company) [Internet Widgits Pty Ltd]: <strong>LuvUnix<\/strong><br>Organizational Unit Name (eg, section) []:<strong>IT<\/strong><br>Common Name (eg, YOUR name) []:<strong>localhost<\/strong><br>Email Address []: <strong><em>Blank<\/em><\/strong><\/p>\n\n\n\n<p>Please enter the following \u2018extra\u2019 attributes<br>to be sent with your certificate request<br>A challenge password []: <strong><em>Blank<\/em><\/strong><br>An optional company name []: <strong><em>Blank<\/em><\/strong><\/p>\n\n\n\n<p><strong>#Step 3: Remove Passphrase from Key<\/strong><br>[root@localhost bin]# <strong><em>copy server.key server.key.org&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<\/em><\/strong><br>1 file(s) copied.<\/p>\n\n\n\n<p>[root@localhost bin]# <strong><em>openssl rsa -in server.key.org -out server.key<\/em><\/strong><br>Enter pass phrase for server.key.org:<br>writing RSA key<\/p>\n\n\n\n<p><strong>#Step 4: Generating a Self-Signed Certificate<\/strong><br>[root@localhost bin]# <em><strong>openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt&nbsp;<\/strong><\/em><br>Loading \u2018screen\u2019 into random state \u2013 done<br>Signature ok<br>subject=\/C=IN\/ST=CHD\/L=CHD\/O=LuvUnix\/OU=IT\/CN=localhost\/emailAddress=<br>Getting Private key<\/p>\n\n\n\n<p><strong>#Step 5: Installing the Private Key and Certificate<\/strong><br>[root@localhost bin]# <strong><em>copy server.crt <\/em>\/opt\/lampp\/etc\/ssl.crt\/<\/strong><br>[root@localhost bin]# <strong><em>copy server.key <\/em>\/opt\/lampp\/etc\/ssl.key\/<\/strong><\/p>\n\n\n\n<p><strong>#Step 6: Restart Apache and Test&nbsp;<\/strong><br>Restart Apache<\/p>\n\n\n\n<p><strong>Credit :- latunyj.wordpress.com<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Below are the steps and additional information used to generate self-signed certificate and keys for Apache Web server in XAMPP for Win32 platform. #Step 1: Generate a Private Key[root@localhost bin]#openssl genrsa -des3 -out server.key 1024&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Loading \u2018screen\u2019 into random state \u2013 doneGenerating RSA private key, 1024 bit long modulus\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026++++++\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026++++++e is 65537 (0\u00d710001)Enter pass phrase for server.key: ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"http:\/\/symbioticindia.in\/docu\/2021\/05\/06\/generating-self-signed-certificate-in-xampp-apache-web-server-windows-linux\/\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-301","post","type-post","status-publish","format-standard","hentry","category-xampp"],"_links":{"self":[{"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/posts\/301","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/comments?post=301"}],"version-history":[{"count":1,"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/posts\/301\/revisions"}],"predecessor-version":[{"id":302,"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/posts\/301\/revisions\/302"}],"wp:attachment":[{"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/media?parent=301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/categories?post=301"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/tags?post=301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}