{"id":6664,"date":"2020-06-27T16:42:06","date_gmt":"2020-06-27T21:42:06","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=6664"},"modified":"2020-06-27T16:42:40","modified_gmt":"2020-06-27T21:42:40","slug":"apache-httpd-ssl-virtual-hosts","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=6664","title":{"rendered":"Apache HTTPD: SSL Virtual Hosts"},"content":{"rendered":"<p>For quite some time, you couldn&#8217;t bind multiple SSL web sites to a single IP:Port combination &#8212; this had to do with the mechanics of negotiating an SSL session &#8212; the client and server negotiated encryption based on a specific certificate before the server really knew what the client was trying to retrieve. The quick\/easy solution was to just add a virtual IP to the box and bind each individual web site to a unique IP address. While this was quite effective in a corporate environment or purely internal network, it was a terrible solution for a set of home-hosted personal web servers &#8212; I don&#8217;t want to buy four public IP addresses to host four differently named websites. My workaround was to off-port sites no one else would be using (the MQTT WebSockets reverse proxy) and use a reverse proxy to map paths within the family website to the remaining web servers. This page, for instance, is rushworth.us\/lisa &#8230; which the reverse proxy re-maps to https:\/\/lisa.rushworth.us behind the scenes.<\/p>\n<p>With Apache HTTPD 2.2.12 or later built against OpenSSL v0.9.8g or later, you can use <a href=\"https:\/\/www.ietf.org\/rfc\/rfc4366.txt\" target=\"_blank\" rel=\"noopener noreferrer\">Server Name Indication (SNI)<\/a> to serve multiple SSL websites from a single IP:Port just like you have been able to do with non-SSL sites. Using SNI, the client includes &#8220;what they&#8217;re looking for&#8221; in first message of the SSN negotiation process so the server knows which cert to serve.<\/p>\n<p>In your httpd.conf, indicate that you want to use SNI on an IP:Port combo<\/p>\n<pre># Listen for virtual host requests on all IP addresses\r\nNameVirtualHost *:443<\/pre>\n<p>And, optionally, configure one of the named virtual hosts as the default for non-SNI browsers:<\/p>\n<pre>SSLStrictSNIVHostCheck off<\/pre>\n<p>Now the configuration for your SSL sites can include a ServerName directive. Restart Apache HTTPD, and you&#8217;ll be able to access the proper SSL-enabled website without adding virtual IP addresses.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For quite some time, you couldn&#8217;t bind multiple SSL web sites to a single IP:Port combination &#8212; this had to do with the mechanics of negotiating an SSL session &#8212; the client and server negotiated encryption based on a specific certificate before the server really knew what the client was trying to retrieve. The quick\/easy &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[31,352,374,1038],"class_list":["post-6664","post","type-post","status-publish","format-standard","hentry","category-system-administration","tag-apache","tag-httpd","tag-httpd-conf","tag-virtual-host"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/6664","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6664"}],"version-history":[{"count":1,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/6664\/revisions"}],"predecessor-version":[{"id":6665,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/6664\/revisions\/6665"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6664"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6664"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6664"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}