Can I use a single certificate for two domains which are hosted on the same VPS that is using one IP address?
Asked
Active
Viewed 1,155 times
3 Answers
4
Use the NameVirtualHost directive :
NameVirtualHost *:443
define your vhosts:
<VirtualHost *:443>
ServerName www.studyhat.blogspot.com
DocumentRoot "/opt/apache22/htdocs/siteA"
SSLCertificateFile "/path/to/my/cert"
SSLCertificateKeyFile "/path/to/my/key"
</VirtualHost>
<VirtualHost *:443>
ServerName www.studyhat.wordpress.com
DocumentRoot "/opt/apache22/htdocs/siteB"
SSLCertificateFile "/path/to/my/cert"
SSLCertificateKeyFile "/path/to/my/key"
</VirtualHost>
neolix
- 538
3
Yes it is possible. This is called a Unified Communication Certificate. Refer to this wikipedia article.
Lucas Kauffman
- 16,990
0
As detailed in this answer, you essentially get 3 options:
- Using a wildcard certificate: a certificate issued for
*.example.comthat would matchwww1.example.comandwww2.example.com. Beware*.example.comwill not matchexample.com. In addition, their usage is generally discouraged (see RFC 6215). - Using a certificate with multiple Subject Alternative Name entries. There should be one entry per host. This is generally widely supported. How they're called commercially will depend on the CA (they're sometimes called UCC).
- Using multiple certificates via the Server Name Indication extension (allowing you to have multiple
VirtualHost *:443with distinctServerNames andSSLCertificateconfiguration). This is not supported for any version of IE on Windows XP and may cause problem with some mobile browsers too.