default.conf
<VirtualHost *:80>
DocumentRoot /var/www/example
ServerName example.com
DirectoryIndex index.php index.html
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/subdomain
ServerName subdomain.example.com
DirectoryIndex index.php index.html
</VirtualHost>
default-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
DocumentRoot /var/www/example/public
SSLEngine on
SSLCertificateFile /var/www/Origin.crt
SSLCertificateKeyFile /var/www/Key.key
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
# BrowserMatch "MSIE [2-6]" \
# nokeepalive ssl-unclean-shutdown \
# downgrade-1.0 force-response-1.0
</VirtualHost>
<VirtualHost *:443>
DocumentRoot /var/www/subdomain/public
SSLEngine on
SSLCertificateFile /var/www/Origin.crt
SSLCertificateKeyFile /var/www/Key.key
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
# BrowserMatch "MSIE [2-6]" \
# nokeepalive ssl-unclean-shutdown \
# downgrade-1.0 force-response-1.0
</VirtualHost>
</IfModule>
If I delete the main site, it loads the subdomain perfectly. If the main site is enabled the subdomains loads the main site. By load I mean it doesn't redirect, it just loads the main site directory.