Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have the file underneath in my vhosts.d directory and it's called hosts.conf (from what I gather the name isn't a problem). Now there are various hosts as you can see, if I use http (port 80) no problems at all I can bounce form one website to the other, but if I use https (port 443) whatever website I type in my browser i always end up in the website that is first listed with the 443 port (in this case mobile-dev1.*.it). Obviously my real file doesn't have * written but the proper website name.

<VirtualHost 10.65.200.7:80>
    DocumentRoot "/srv/www/htdocs/public"
    ServerName portal.***.it
    <Directory "/srv/www/htdocs/public">
        allow from all
    </Directory>
</VirtualHost>

<VirtualHost 10.65.200.7:80>
DocumentRoot /srv/mobile-dev1/public
ServerName mobile-dev1.***.it
<Directory /srv/mobile-dev1/public>
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost 10.65.200.7:443>
DocumentRoot /srv/mobile-dev1/public
ServerName mobile-dev1.***.it
    SSLEngine on
    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    SSLCertificateFile    /etc/ssl/certs/wildcard_***_it.pem
    SSLCertificateKeyFile /etc/ssl/private/wildcard_***_it.key
    SSLCertificateChainFile /etc/ssl/certs/RapidSSLCA.crt
<Directory /srv/mobile-dev1/public>
allow from all
Options +Indexes
</Directory>

<VirtualHost 10.65.200.7:80>
DocumentRoot /srv/mobile-dev2/public
ServerName mobile-dev2.***.it
<Directory /srv/mobile-dev2/public>
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost 10.65.200.7:443>
DocumentRoot /srv/mobile-dev2/public
ServerName mobile-dev2.***.it
    SSLEngine on
    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    SSLCertificateFile    /etc/ssl/certs/wildcard_***_it.pem
    SSLCertificateKeyFile /etc/ssl/private/wildcard_***_it.key
    SSLCertificateChainFile /etc/ssl/certs/RapidSSLCA.crt
<Directory /srv/mobile-dev2/public>
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost 10.65.200.7:80>
DocumentRoot /srv/mobile-test/public
ServerName mobile-test.***.it
<Directory /srv/mobile-test/public>
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost 10.65.200.7:443>
DocumentRoot /srv/mobile-test/public
ServerName mobile-test.***.it
    SSLEngine on
    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    SSLCertificateFile    /etc/ssl/certs/wildcard_***_it.pem
    SSLCertificateKeyFile /etc/ssl/private/wildcard_***_it.key
    SSLCertificateChainFile /etc/ssl/certs/RapidSSLCA.crt
<Directory /srv/mobile-test/public>
allow from all
Options +Indexes
</Directory>
</VirtualHost>

Thank you for any help, the problem is driving me mad as it will likely be something simple..

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Two things spring to mind:

  • You don't have a NameVirtualHosts directive. It might be in one of your other config files, but you'll need NameVirtualHosts 10.65.200.7:443 somewhere for this to work.

  • You might be using a browser that doesn't support SNI. If memory serves, no version of IE under XP supports SNI. You need this because you have several SSL vhosts that share an IP address, and the only way the webserver can differentiate between them is by using SNI.

share|improve this answer
    
I'm using firefox under windows 7 so shouldn't be a SNI problem. I need to look into the NameVitrualHosts thing, should it be in my hosts file or somewhere else? –  James Jul 22 '13 at 9:01
    
ok it was the namevirtualhosts directive, thanks a lot!! –  James Jul 22 '13 at 9:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.