Eu não tenho reputação suficiente para comentar. Então vou postar resposta. Primeira coisa primeiro você deve ter sub-domínio e depois do domínio. Depende da ordem, portanto, primeiro deve ser configurado subdomínios e, finalmente, todo o domínio raiz. Eu mostro minha configuração que funciona perfeitamente:
/etc/apache2/sites-available/example.conf:
# ====================SSL========================
<IfModule mod_ssl.c>
## a.example.com
<VirtualHost *:443>
ServerAdmin [email protected]
ServerName a.example.com
ServerAlias *.a.example.com
DocumentRoot /home/a.example.com/www/public_html
ErrorLog /home/a.example.com/www/logs/ssl_error.log
CustomLog /home/a.example.com/www/logs/ssl_access.log combined
SSLEngine on
SSLCertificateFile /home/a.example.com/www/ssl/a.example.com.crt
SSLCertificateKeyFile /home/a.example.com/www/ssl/a.example.com.key
SSLCertificateChainFile /home/a.example.com/www/ssl/a.example.com.ca-bundle.crt
<Directory /home/a.example.com/www/public_html>
Options FollowSymLinks -MultiViews
AllowOverride All
Order allow,deny
Allow from all
Satisfy Any
</Directory>
</VirtualHost>
## /a.example.com
## example.com
<VirtualHost *:443>
ServerAdmin [email protected]
ServerName example.com
ServerAlias *.example.com
DocumentRoot /home/example.com/www/public_html/
<Directory /home/example.com/www/public_html/>
Options FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /home/example.com/www/logs/ssl_error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /home/example.com/www/logs/ssl_access.log combined
# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine on
SSLCertificateFile /home/example.com/www/ssl/example.com.crt
SSLCertificateKeyFile /home/example.com/www/ssl/example.com.key
SSLCertificateChainFile /home/example.com/www/ssl/example.com.ca-bundle.crt
# SSL Engine Options:
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
# SSL Protocol Adjustments:
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
# MSIE 7 and newer should be able to use keepalive
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
</VirtualHost>
## /example.com
</IfModule>
# ====================/SSL========================
Lembre-se de que você deve comparar a configuração com seu ambiente, então adicione mais domínios como a.example.com antes de example.com. Espero que minha resposta tenha ajudado você de alguma forma.