Last (I think and hope) problems configuring SSL certificate with Apache and VirtualHosts

Posted by user65567 on Server Fault See other posts from Server Fault or by user65567
Published on 2011-01-06T00:26:24Z Indexed on 2011/01/06 0:57 UTC
Read the original article Hit count: 609

Filed under:
|
|
|
|

Finally I set apache2 to get a single certificate for all subdomains.

[...]

# Go ahead and accept connections for these vhosts
# from non-SNI clients
SSLStrictSNIVHostCheck off


# Apache setup which will listen for and accept SSL connections on port 443.
Listen 443
# Listen for virtual host requests on all IP addresses
NameVirtualHost *:443


# Because this virtual host is defined first, it will
# be used as the default if the hostname is not received
# in the SSL handshake, e.g. if the browser doesn't support
# SNI.
<VirtualHost *:443>
  ServerName domain.localhost
  DocumentRoot "/Users/<my_user_name>/Sites/domain/public"

  <Directory "/Users/<my_user_name>/Sites/domain/public">
    Order allow,deny
    Allow from all
  </Directory>

  # SSL Configuration
  SSLEngine on
  ...
</VirtualHost>


<VirtualHost *:443>
  ServerName subdomain1.domain.localhost
  DocumentRoot "/Users/<my_user_name>/Sites/subdomain1/public"

  <Directory "/Users/<my_user_name>/Sites/subdomain1/public">
    Order allow,deny
    Allow from all
  </Directory>

  # SSL Configuration
  SSLEngine on
  ...
</VirtualHost>


<VirtualHost *:443>
  ServerName subdomain2.domain.localhost
  DocumentRoot "/Users/<my_user_name>/Sites/subdomain2/public"

  <Directory "/Users/<my_user_name>/Sites/subdomain2/public">
    Order allow,deny
    Allow from all
  </Directory>

  # SSL Configuration
  SSLEngine on
  ...
</VirtualHost>

So, for example, I can correctly access

https://subdomain1.domain.localhost
https://subdomain2.domain.localhost
...

Now, anyway, I have problems on accessing

http://subdomain1.domain.localhost
http://subdomain2.domain.localhost
...

Since I use a Mac Os, on accessing the "http: version", I get a default page "Your website." (instead of a error). Why does it happen?

© Server Fault or respective owner

Related posts about apache

Related posts about server