Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This question already has an answer here:

I have the following in my httpd.conf file

NameVirtualHost *:80

<IfModule mod_vhost_alias.c>
  <VirtualHost *:80>
    ServerAlias *
    UseCanonicalName Off
    LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
    CustomLog /var/log/httpd/access_log vcommon
    VirtualDocumentRoot /web-data/vhosts/%0/httpdocs
    VirtualScriptAlias  /web-data/vhosts/%0/httpdocs
  </VirtualHost>
</IfModule>

This works great for dynamic hosting. However, I can't figure out how to make https requests work the same way. What do I need to add to this so that https and http for the same domain request get sent to the same folder?

share|improve this question

marked as duplicate by Jenny D, Rex, Ward, dawud, Katherine Villyard Feb 22 at 15:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

It is not technically possible with Apache2 to do this without a wildcard SSL certificate as Apache will have only 1 certificate to serve. I.e. your certificate will say it's for "myxtx.com" yet the request will be for "mydomain2.com".

See NameBasedSSLVHosts

However, it is possible using some extension but this is too complicated to explain all in one post here. So here is a link: NameBasedSSLVHostsWithSNI

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.