1

I have configured a virtual host on 80 and 443 ports (Centos 5.6 and Apache 2.2.3), following is the configuration I have written:

Listen 80  
Listen 443  
NameVirtualHost *:80  
NameVirtualHost *:443  
<VirtualHost *:80>  
ServerAdmin [email protected]  
ServerName  www.abc.be  
ServerAlias abc.be  
.  
. 
</VirtualHost>
<VirtualHost *:80>  
ServerAdmin [email protected]  
ServerName  www.abc.fr  
ServerAlias abc.fr  
.  
. 
</VirtualHost>  

then I define 443:

<VirtualHost *:443>  
ServerAdmin [email protected]  
ServerName  www.abc.be  
ServerAlias abc.be  
.  
.  
SSLEngine on  
SSLCertificateFile /etc/ssl/private/abc.be.crt  
SSLCertificateKeyFile /etc/ssl/private/abc.be.key  
SSLCertificateChainFile /etc/ssl/private/gd_bundle_be.crt
</VirtualHost>  
<VirtualHost *:443>  
ServerAdmin [email protected]  
ServerName  www.abc.fr  
ServerAlias abc.fr  
.  
.  
SSLEngine on  
SSLCertificateFile /etc/ssl/private/abc.fr.crt  
SSLCertificateKeyFile /etc/ssl/private/abc.fr.key  
SSLCertificateChainFile /etc/ssl/private/gd_bundle_fr.crt
</VirtualHost>  

First SSL certificate for the abc.be is working fine, but 2nd domain abc.fr still sends the first SSL.

Following is the output of apachictl -s:

VirtualHost configuration:  
wildcard NameVirtualHosts and _default_ servers:  
*:443                  is a NameVirtualHost  
default server www.abc.be (/etc/httpd/conf/httpd.conf:1071)  
port 443 namevhost www.abc.fr (/etc/httpd/conf/httpd.conf:1071)  
1

2 Answers 2

0

That's entirely expected. See Why is it not possible to use Name-Based Virtual Hosting to identify different SSL virtual hosts? and for a possible solution, Server Name Indication.

3
  • Hi, As per mentioned in link, it required apache version 2.2.2 and latest version of web browser. I am already using latest version of browser and apache version of 2.2.3.
    – user1703321
    Sep 28, 2012 at 21:04
  • Hi, As per mentioned in link, it required apache version 2.2.2 and latest version of web browser. I am already using latest version of browser and apache version of 2.2.3. But openssl version should be 0.9.8j or latter. But on my server openssl version is 0.9.8e. Now let me update openssl and see the output.
    – user1703321
    Sep 28, 2012 at 21:12
  • @user1703321: It is also mentioned that you need openssl 0.9.8f+. I think Centos 5.6 has an older openssl library.
    – Lacek
    Oct 1, 2012 at 10:01
0

If you have more than one IP address, or can get one, you can bind each SSL host to a different IP.

<VirtualHost 1.2.4.5:443>  
ServerAdmin [email protected]  
ServerName  www.abc.be  
ServerAlias abc.be  
...
SSLEngine on  
SSLCertificateFile /etc/ssl/private/abc.be.crt  
SSLCertificateKeyFile /etc/ssl/private/abc.be.key  
SSLCertificateChainFile /etc/ssl/private/gd_bundle_be.crt 
...

<VirtualHost 5.6.7.8:443>    
ServerAdmin [email protected]  
ServerName  www.abc.fr  
ServerAlias abc.fr  
...
SSLEngine on  
SSLCertificateFile /etc/ssl/private/abc.fr.crt  
SSLCertificateKeyFile /etc/ssl/private/abc.fr.key  
SSLCertificateChainFile /etc/ssl/private/gd_bundle_fr.crt
...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .