I setup a subdomain in my sites-available folder, enabled it and done everything needed so that it restarts apache2 with no errors (changing default:443 to *:443, adding NameVirtualHost *:443 to ports.conf, etc).
The subdomain now works perfectly but when I try to access any page using SSL on the main domain it jumps to my error page. It seems to have taken over all SSL.
Ex: subdomain.domain.com
Apache2 error: File does not exist: /var/www/subdomain/foldername
It should not be reading from the subdomain folder for this. My guess is it is a problem in my virtual host setup below:
<VirtualHost *:443>
ServerName subdomain.domain.com
ServerAlias subdomain.domain.com
VirtualDocumentRoot /var/www/subdomain/
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/domain.com.crt
SSLCertificateKeyFile /etc/apache2/ssl/domain.com.key
SSLCertificateChainFile /etc/apache2/ssl/domain.com.crt
SSLCACertificateFile /etc/apache2/ssl/bundle.crt
SSLProtocol all
SSLCipherSuite HIGH:MEDIUM
</VirtualHost>
Results of apachectl -S:
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:443 is a NameVirtualHost
default server subdomain.domain.com (/etc/apache2/sites-enabled/subdomain.domain.com:1)
port 443 namevhost subdomain.domain.com (/etc/apache2/sites-enabled/subdomain.domain.com:1)
port 443 namevhost *.domain.com (/etc/apache2/sites-enabled/default-ssl:2)
*:80 is a NameVirtualHost
default server production1 (/etc/apache2/sites-enabled/000-default:1)
port 80 namevhost production1 (/etc/apache2/sites-enabled/000-default:1)
Syntax OK