{"id":630,"date":"2012-12-12T13:17:03","date_gmt":"2012-12-12T18:17:03","guid":{"rendered":"http:\/\/blog.xfloyd.net\/?p=630"},"modified":"2018-04-25T08:09:20","modified_gmt":"2018-04-25T13:09:20","slug":"apache-2-ssl-self-signed-and-requested-and-multi-site","status":"publish","type":"post","link":"https:\/\/xfloyd.net\/blog\/?p=630","title":{"rendered":"Apache 2 SSL, self signed and requested and multi site"},"content":{"rendered":"<pre>openssl genrsa -out www.domain.com.key 2048<\/pre>\n<pre>openssl req -new -key www.domain.com.key -out www.domain.com.csr<\/pre>\n<p>Answer the questions! For &#8216;Common Name&#8217; put the first domain name (<code>www.domain.tld<\/code>). Be careful to make sure all the info is correct.<\/p>\n<p><!--more--><\/p>\n<p><strong>At this point you are done with cert request. Below is how to create self-signed cert.<\/strong><\/p>\n<p>Create a extensions config file for the certificate generation (you can throw this away when you&#8217;re done). This is the important bit for getting the extra domains in. You need to list ALL the domains, since the Common Name you set above is only used in the absence of the subjectAltNames field (I think).<\/p>\n<p>Create <code>www.domain.com.cnf<\/code><\/p>\n<p>insert this to it<\/p>\n<div>\n<pre>subjectAltName=DNS:www.domain.com,DNS:www2.domain.com<\/pre>\n<p>Then run:<\/p>\n<pre>openssl x509 -req -days 365 -in www.domain.com.csr -signkey www.domain.com.key -text -extfile www.domain.com.cnf -out www.domain.com.crt<\/pre>\n<p>Last add ssl stuff to your SSL VirtualHost<\/p>\n<pre>SSLEngine on\r\nSSLCertificateFile \/etc\/apache2\/ssl\/CERT_NAME.com.crt\r\nSSLCertificateKeyFile \/etc\/apache2\/ssl\/CERT_NAME.key<\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>openssl genrsa -out www.domain.com.key 2048 openssl req -new -key www.domain.com.key -out www.domain.com.csr Answer the questions! For &#8216;Common Name&#8217; put the first domain name (www.domain.tld). Be careful to make sure all the info is correct.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/630"}],"collection":[{"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=630"}],"version-history":[{"count":7,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/630\/revisions"}],"predecessor-version":[{"id":1086,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/630\/revisions\/1086"}],"wp:attachment":[{"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=630"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=630"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=630"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}