I have a server with two web application that configured as follow:
app1:
www.domain1.com
has https version
app2:
www.domain1.com
has not https version
This is my VirtualHost config for domain1:
Listen 443
NameVirtualHost *:443
SSLStrictSNIVHostCheck off
<VirtualHost --ip--:80>
ServerName www.domain1.com
DocumentRoot /usr/local/ROOT
<Directory /usr/local/ROOT>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from All
</Directory>
errorlog /var/log/httpd/domain1.error.log
CustomLog /var/log/httpd/domain1.access.log common
JkMount /* ajpmc
</VirtualHost>
<VirtualHost --ip--:443>
ServerName www.domain1.com:443
DocumentRoot /usr/local/ROOT
<Directory /usr/local/ROOT>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from All
</Directory>
errorlog /var/log/httpd/domain1.error.log
CustomLog /var/log/httpd/domain1.access.log common
SSLEngine on
SSLCertificateFile "/usr/local/security/paadbox.cert"
SSLCertificateKeyFile "/usr/local/security/paadbox.pem"
JkMount /* ajpmc
</VirtualHost>
Edit: And this is configuration for domain2:
<VirtualHost --ip--:80>
ServerName www.domain2.com
DocumentRoot /var/www/html/domain2
<Directory /var/www/html/domain2>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from All
</Directory>
errorlog /var/log/httpd/domain2.error.log
CustomLog /var/log/httpd/domain2.access.log common
</VirtualHost>
Note that I have just 1 ip.
These urls works fine in browser:
http://www.domain1.com
http://www.domain2.com
https://www.domain1.com
And when I try to load this URL (app2):
https://www.domain2.com
the first app (app1) loads in my browser. What is the problem???
https://www.domain2.com/
? You only have one vhost on port 443 so that's the vhost users are going to get, no matter what domain they have in their URL. If you expect something different, you should add your expectation to your question.