Share one ssl certificate between multiples vhost
- by Cesar
I have a setup like this:
<VirtualHost 192.168.1.104:80>
ServerName domain1
DocumentRoot /home/domain/public_html
...
</VirtualHost>
<VirtualHost 192.168.1.104:80>
ServerName domain2
DocumentRoot /home/domain2/public_html
...
</VirtualHost>
<VirtualHost 192.168.1.104:80>
DocumentRoot /home/domain3/public_html
ServerName domain3
...
</VirtualHost>
<VirtualHost 192.168.1.104:443>
ServerName domain3
SSLCertificateFile /usr/share/ssl/certs/certificate.crt
SSLCertificateKeyFile /usr/share/ssl/private/private.key
SSLCACertificateFile /usr/share/ssl/certs/bundle.cabundle
...
</VirtualHost>
I want to use domain3 certificate in the other domains, preferably without having to repeat all the <VirtualHost 192.168.1.104:443> config.
In other words I want something like this: If the vhost has no explicit ssl config use cert for domain3 (/usr/share/ssl/certs/certificate.crt)
Notes:
1.- I for sure will be setting more vhosts in the future
2.- I know (and don't care) of the ssl warnings the browser will show (hostname mismatch)
If this possible? how?