{"id":287,"date":"2010-12-12T16:39:42","date_gmt":"2010-12-12T16:39:42","guid":{"rendered":"http:\/\/cdblog.cdstealer.com\/?p=287"},"modified":"2011-10-15T11:37:33","modified_gmt":"2011-10-15T10:37:33","slug":"httpshttp-virtual-hosts","status":"publish","type":"post","link":"https:\/\/cdblog.cdstealer.com\/?p=287","title":{"rendered":"HTTPS\/HTTP Virtual Hosts"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-311\" title=\"apache_feather\" src=\"http:\/\/cdblog.cdstealer.com\/wp-content\/uploads\/2010\/12\/apache_feather.png\" alt=\"\" width=\"750\" height=\"212\" srcset=\"https:\/\/cdblog.cdstealer.com\/wp-content\/uploads\/2010\/12\/apache_feather.png 750w, https:\/\/cdblog.cdstealer.com\/wp-content\/uploads\/2010\/12\/apache_feather-300x84.png 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/>Sometimes there is a need to have vitual hosts (vhosts,Name-based virtual hosts) <a title=\"Wikipedia vhosts\" href=\"http:\/\/en.wikipedia.org\/wiki\/Virtual_hosting\" target=\"_blank\">wikipedia<\/a><\/p>\n<p>To enable https vhosts, use this example in \/etc\/apache2\/vhosts.d\/00_default_ssl_vhost.conf:<\/p>\n<pre>NameVirtualHost *:443\r\n\r\n&lt;VirtualHost *:443&gt;\r\n SSLEngine on\r\n SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL\r\n SSLCertificateFile \/path\/to\/your\/cert.crt\r\n SSLCertificateKeyFile \/path\/to\/your\/cert.key\r\n\r\n ServerName vhost1.cdstealer.com\r\n SSLOptions StrictRequire\r\n SSLProtocol all -SSLv2\r\n\r\n DocumentRoot \/path\/to\/your\/htdocs\/vhost\r\n &lt;Directory \/path\/to\/your\/htdocs\/vhost&gt;\r\n SSLRequireSSL\r\n Order Deny,Allow\r\n Allow from All\r\n &lt;\/Directory&gt;\r\n\r\n &lt;IfModule log_config_module&gt;\r\n TransferLog \/var\/log\/apache2\/ssl_access_log\r\n &lt;\/IfModule&gt;\r\n\r\n&lt;\/VirtualHost&gt;<\/pre>\n<p>To enable http vhosts, use this example in \/etc\/apache2\/vhosts.d\/00_default_vhost.conf:<\/p>\n<pre>NameVirtualHost *:80\r\n\r\n&lt;VirtualHost *:80&gt;\r\n ServerName vhost1.cdstealer.com\r\n DocumentRoot \/path\/to\/your\/htdocs\/vhost\/\r\n &lt;Directory \/path\/to\/your\/htdocs\/vhost\/&gt;\r\n Allow from All\r\n &lt;\/Directory&gt;\r\n &lt;IfModule mpm_peruser_module&gt;\r\n ServerEnvironment apache apache\r\n &lt;\/IfModule&gt;\r\n&lt;\/VirtualHost&gt;<\/pre>\n<p>However, doing this won't be enough.\u00a0 Your DNS host will also need a CNAME\u00a0 to point to your server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Sometimes there is a need to have vitual hosts (vhosts,Name-based virtual hosts) wikipedia To enable https vhosts, use this example in \/etc\/apache2\/vhosts.d\/00_default_ssl_vhost.conf: NameVirtualHost *:443 &lt;VirtualHost *:443&gt; SSLEngine on SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL SSLCertificateFile \/path\/to\/your\/cert.crt SSLCertificateKeyFile \/path\/to\/your\/cert.key ServerName vhost1.cdstealer.com SSLOptions StrictRequire SSLProtocol all -SSLv2 DocumentRoot \/path\/to\/your\/htdocs\/vhost &lt;Directory \/path\/to\/your\/htdocs\/vhost&gt; SSLRequireSSL Order Deny,Allow Allow from All &lt;\/Directory&gt; &lt;IfModule log_config_module&gt; &hellip; <a href=\"https:\/\/cdblog.cdstealer.com\/?p=287\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">HTTPS\/HTTP Virtual Hosts<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[45,46,47],"class_list":["post-287","post","type-post","status-publish","format-standard","hentry","category-gentoo","tag-apache","tag-http","tag-httpd"],"_links":{"self":[{"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=\/wp\/v2\/posts\/287","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=287"}],"version-history":[{"count":5,"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=\/wp\/v2\/posts\/287\/revisions"}],"predecessor-version":[{"id":540,"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=\/wp\/v2\/posts\/287\/revisions\/540"}],"wp:attachment":[{"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=287"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=287"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=287"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}