1
I have on one of our servers two SSL certs running for two projects, one of which is a wildcard SSL issued to that domain only, which I'll call domain2.com. domain1.com, the other domain has the domain issued to one subdomain only, called servers.
Due to domain2 allowing users on the project to create subdomains, it has a VirtualHost setup looking like this:
<VirtualHost *:443>
<Directory /var/www/domain2>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
#There's a SSL redirection here -
#stackexchange network detected it as a URL shortener, so removed from question
SSLEngine on
SSLCertificateFile /app/domain2/certs/domain2.com.pem
SSLCertificateKeyFile /app/domain2/certs/domain2.com.key
SSLCertificateChainFile "/app/domain2/certs/fullchain.pem"
SSLCACertificatePath "/app/domain2/certs/"
SSLCACertificateFile "/app/domain2/certs/cacert.pem"
ServerAdmin webmaster@localhost
DocumentRoot /var/www/domain2
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
This works fine, however the servers.domain1.com SSL isn't working (which is issued on letsencrypt, domain2.com is issued with AlphaSSL
<VirtualHost servers.domain1.com:443>
<Directory /app/corporate/mediaserver/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
#There's a SSL redirection here -
#stackexchange network detected it as a URL shortener, so removed from question
SSLEngine on
SSLCertificateFile /app/corporate/mediaserver/certs/[redacted]
SSLCertificateKeyFile /app/corporate/mediaserver/certs/[redacted]
SSLCACertificatePath /app/corporate/mediaserver/certs/[redacted]
SSLCACertificateFile /app/corporate/mediaserver/certs/[redacted]
ServerName servers.domain1.com
ServerAdmin webmaster@localhost
DocumentRoot /app/corporate/mediaserver/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
When I load servers.domain1.com it tries to load in the SSL from the wildcard, however if I set the <VirtualHost>
to <VirtualHost domain1.com:443>
and load domain1.com it loads the SSL from the correct one (servers.domain1.com virtualhost just gets ignored).
Do you have different IP addresses for each domain, or do they all share a single IP address? – user1686 – 2018-02-24T17:35:02.900
They share the same IP address @grawity – Phil Gibson – 2018-02-24T17:35:32.733
Well that's your problem. – user1686 – 2018-02-24T17:40:09.690