1

On my webserver, I have a default host of domain_A.tld set to redirect to domain_B.tld. (This is meant to catch HTTPS connections not matching a defined host and refer them to domain_B.tld.) I recently added subdomain_C.domain_B.tld, or tried to, with the following VirtualHost.

The VirtualHost for subdomain_C.domain_B.tld is:

    <VirtualHost *:443>
        ServerName ____
        ServerAlias ____
        DirectoryIndex index.cgi index.shtml index.html index.html.var
        DocumentRoot /____
        ErrorLog /var/log/apache2/_____error.log
        CustomLog /var/log/apache2/_____access.log combined
        SSLEngine On
        SSLCertificateFile /etc/letsencrypt/live/____/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/____/privkey.pem
        SSLCACertificateFile /etc/letsencrypt/live/____/cert.pem
        ServerAdmin ____
        <Directory />
            Options FollowSymLinks
            AllowOverride None
        </Directory>
        <Directory ____>
            Options ExecCGI Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/____.error.log
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/____.log combined
    </VirtualHost>

The VirtualHost for domain_B.tld is:

    <VirtualHost *:443>
        ServerName ____
        ServerAlias ____
        DirectoryIndex index.php index.cgi index.shtml index.html index.html.var
        DocumentRoot /____
        ErrorLog /var/log/apache2/_____error.log
        CustomLog /var/log/apache2/_____access.log combined
         SSLEngine On
         SSLCertificateFile /____/fullchain.pem
         SSLCertificateKeyFile /____/privkey.pem
         SSLCACertificateFile /____/cert.pem
        ServerAdmin ____
        <Directory />
            Options FollowSymLinks
            AllowOverride None
        </Directory>
        <Directory /____/>
            Options ExecCGI Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/____.log
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/____.log combined
    RewriteEngine on
    RewriteRule ^____$ ____ [R=301,L]
    RewriteRule ^____$ /____/$1 [R=301,L]
    </VirtualHost>

However, what is happening is that my attempts to connect to https://subdomain_C.domain_B.tld are being directed to https://domain_B.tld.

I'm having some difficulties pinning this down. Apache (Server version: Apache/2.4.10 (Debian); Server built: Nov 28 2015 14:05:48) starts without reported error, and the directory /etc/letsencrypt/live/subdomain_C.domain_B.tld is populated. The behavior appears consistently when I try to load the page with another browser which has not previously been asked to load https://subdomain_C.domain_B.tld. Also, the root directory I tried to specify contains a static index.html as its only index.*, and the index.html file is simple with no meta refresh or JavaScript at all.

Where else should I look to get https://subdomain_C.domain_B.tld to display the index.html file without redirecting to https://domain_B.tld or other different locations?

Thanks,

3
  • Is this the configuration for subdomain_C.domain_B.tld? What is the configuration for domain_B.tld? Jun 23, 2016 at 12:56
  • @TeroKilkanen Thank you, it was the configuration for subdomain_C.domain_B.tld. I've edited the post to clarify and to add the configuration for domain_B.tld. Would you review it? Jun 23, 2016 at 16:54
  • This is because you are not using a Name-Based vhost wiki.apache.org/httpd/NameBasedSSLVHosts Last I checked, you cannot setup multiple SSL certificate on a single IP address.
    – vagarwal
    Jun 23, 2016 at 17:04

0

You must log in to answer this question.

Browse other questions tagged .