O
O
Oc3602019-12-04 17:35:37
Apache HTTP Server
Oc360, 2019-12-04 17:35:37

Wrong SSL on subdomains?

There are 2 domains site1.ru and site2.ru both have ssl. I added the test.site2.ru subdomain, and a certificate from site1.ru was automatically connected to it.

config

site2.ru.conf:
<VirtualHost *:80>
        ServerAdmin [email protected]
        DocumentRoot /var/www/site2.ru/public_html
        ServerName site2.ru
        ServerAlias www.site2.ru
</VirtualHost>
<VirtualHost *:443>
        SSLEngine on
        SSLCertificateFile /etc/ssl/site2.ru/site2.ru.crt
        SSLCertificateKeyFile /etc/ssl/site2.ru/private.key
        SSLCertificateChainFile /etc/ssl/site2.ru/chain.crt

        ServerName site2.ru
        DocumentRoot /var/www/site2.ru/public_html
        DirectoryIndex index.php index.html
</VirtualHost>

<VirtualHost *:80>
        DocumentRoot /var/www/test.site2.ru/dist
        ServerName test.site2.ru
</VirtualHost>

site1.ru.conf: аналогичный конфиг, но со своими путями для ssl

It turns out that I need to disable the certificate for the test.site2.ru subdomain altogether. Tried adding a VirtualHost for the subdomain with SSLEngine off, however, that didn't work. And I can’t understand: why is the ssl of the site1.ru domain assigned to the test.site2.ru domain?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question