LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 09-24-2010, 05:21 AM   #1
LBM
Member
 
Registered: Aug 2010
Location: Denmark
Distribution: Debian
Posts: 87

Rep: Reputation: 0
Apache2 Multiple SSL vhost in different vhost files, does not work


I have two sites (actually more) configured in apache2.
All sites have their own vhost file, which I enable or disable with a2enmod or a2dismod.

This works fine.

I have configured some SSL sites inside the vhost files, where I have created two different certificates. One for each site.

BUT, if I enable example2.com, it will always load the certificate from webmail.example1.com when i go to the ssl site webmail.example2.com, nomather what (because it comes first in the alphabet maybe) ?.

If I then uncomment the SSL site for example1.com if will work fine with webmail.example2.com, but of course then the site for webmail.example1.com is not working since it is uncommented.

So for some reason, it "falls back" to this site webmail.example1.com everytime, which I have absolutely no idea why it does this. All the other vhost running on port 80 configurations, works fine, but just not the SSL (port 443 ones).

Any clues to what is wrong?

Example1.com:
Code:
<VirtualHost *:80>
    DocumentRoot /home/example1com/wwwroot/
    ServerName www.example1.com:80
    ServerAlias example1.com:80
    TransferLog /home/example1com/logs/access.log
    ErrorLog /home/example1com/logs/error.log
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot /usr/share/phpsysinfo/
    ServerName info.example1.com:80
</VirtualHost>

<VirtualHost *:80>
    ServerName webmail.example1.com:80
    RedirectPermanent / https://webmail.example1.com
</VirtualHost>

<VirtualHost *:443>
    DocumentRoot /usr/share/squirrelmail/
    ServerName webmail.example1.com:443
    SSLEngine on
    SSLOptions +StrictRequire
    SSLCertificateFile /etc/apache2/ssl/webmail_example1_com.crt
    SSLCertificateKeyFile /etc/apache2/ssl/ca.key
</VirtualHost>

Example2.com:
Code:
<VirtualHost *:80>
    DocumentRoot /home/example2com/wwwroot/
    ServerName www.example2.com:80
    ServerAlias example2.com:80
    TransferLog /home/example2com/logs/access.log
    ErrorLog /home/example2com/logs/error.log
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot /usr/share/phpmyadmin/
    ServerName phpmyadmin.example2.com:80
</VirtualHost>

<VirtualHost *:80>
    ServerName webmail.example2.com:80
    RedirectPermanent / https://webmail.example2.com
</VirtualHost>

<VirtualHost *:443>
    DocumentRoot /usr/share/squirrelmail/
    ServerName webmail.example2.com:443
    SSLEngine on
    SSLOptions +StrictRequire
    SSLCertificateFile /etc/apache2/ssl/webmail_example2_com.crt
    SSLCertificateKeyFile /etc/apache2/ssl/ca.key
</VirtualHost>
 
Old 09-24-2010, 05:37 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,937

Rep: Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330
Hi,

Take a look at this to see how to run multiple ssl vhosts.
Basically you need
Code:
SSLStrictSNIVHostCheck off
into every ssl vhost definition

Regards
 
1 members found this post helpful.
Old 09-24-2010, 06:06 AM   #3
LBM
Member
 
Registered: Aug 2010
Location: Denmark
Distribution: Debian
Posts: 87

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
Hi,

Take a look at this to see how to run multiple ssl vhosts.
Basically you need
Code:
SSLStrictSNIVHostCheck off
into every ssl vhost definition

Regards
Thanks man, unfortunately I my apache is not that up to date. (debian lenny).

I also found this, that explains it.
http://linuxindore.com/tips-and-tric...gle-ip-address
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
vhost with ProxyHTMLInterp On/Off correct definition of vhost needed tkmsr Linux - Server 0 07-18-2010 02:12 PM
LXer: How To Set Up An SSL Vhost Under Apache2 On Ubuntu 9.10/Debian Lenny LXer Syndicated Linux News 0 01-21-2010 04:00 PM
ssl vhost mahmoud Linux - Newbie 2 11-28-2008 04:47 AM
Apache: Alias is working on ssl vhost but not on mass vhost jonavogt Linux - Software 0 06-07-2005 02:05 PM
vhost on fc2 install. defaults to 1 vhost only knightdog Linux - Newbie 8 11-12-2004 01:45 PM


All times are GMT -5. The time now is 07:43 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration