I have set up two ssl certificates on apache2 but when i enter with domain the first certificate works and when i enter with server ipadress it shows me the same certificate which i have on domain. I have disabled default and default-ssl vhosts. Here are my virtual hosts:
<VirtualHost *:443>
ServerAdmin mail@example.com
ServerName example.com:443
ServerAlias www.example.com:443
DocumentRoot /var/www/example.com/public_html
ErrorLog /var/log/apache2/error-log.log
CustomLog /var/log/apache2/custom-log.log common
DirectoryIndex index.html index.php index.xhtml index.htm
#Allow phpmyadmin /usr/share/phpmyadmin
<Directory /usr/share/phpmyadmin>
Options -Indexes FollowSymLinks
AllowOverride None
Order deny,allow
allow from all
</Directory>
<Directory />
Options -Indexes FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<Directory /var/www/>
Options FollowSymLinks MultiViews -Includes -ExecCGI -Indexes
AllowOverride All
Order allow,deny
allow from all
LimitRequestBody 104857600
</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 ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
SSLEngine on
SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
SSLCertificateFile /etc/apache2/ssl/first-ssl.crt
SSLCertificateKeyFile /etc/apache2/ssl/first-ssl.key
SSLCertificateChainFile /etc/apache2/ssl/first-ssl.crt
</VirtualHost>
<VirtualHost *:443>
ServerAdmin example@example.com
ServerName 188.226.208.247
DocumentRoot /var/www/
SSLEngine on
SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
SSLCertificateFile /etc/apache2/ssl/second-ssl.crt
SSLCertificateKeyFile /etc/apache2/ssl/second-ssl.key
</VirtualHost>