PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > alt.apache.configuration > https and virtual hosts problem
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
alt.apache.configuration Apache web server configuration issues.

https and virtual hosts problem

Réponse
 
LinkBack Outils de la discussion
Vieux 06/05/2007, 14h52   #1
egod
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut https and virtual hosts problem

I have two sites running on my Apache2 server, acme.com & example.com

Acme.com has SSL enabled as it provides an https payment gateway.
Example.com is http only.

I have configured them as follows:


/etc/apache2/sites-enabled/acme
<VirtualHost 192.168.1.6:80>
ServerName www.acme.com
ServerAlias acme.com
DocumentRoot /var/www/acme
ErrorLog /var/log/apache2/acme-error.log
CustomLog /var/log/apache2/acme-access.log combined
</VirtualHost>
<VirtualHost 192.168.1.6:443>
ServerName www.acme.com
ServerAlias acme.com
DocumentRoot /var/www/acme
ErrorLog /var/log/apache2/acme-error.log
CustomLog /var/log/apache2/acme-access.log combined
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/ssl.crt/www.acme.com.crt
SSLCertificateKeyFile /etc/apache2/ssl/ssl.key/www.acme.com.key
</VirtualHost>

/etc/apache2/sites-enabled/example
NameVirtualHost www.example.com:80
<VirtualHost www.example.com:80>
ServerName www.example.com
ServerAlias example.com
DocumentRoot /var/www/example
ErrorLog /var/log/apache2/example-error.log
CustomLog /var/log/apache2/example-access.log combined
</VirtualHost>


http://www.acme.com - works fine
https://www.acme.com - works fine
http://www.example.com - works fine

https://www.example.com - redirects me to https://www.acme.com!
How do I avoid this happening?


Many thanks


  Réponse avec citation
Vieux 06/05/2007, 15h15   #2
Davide Bianchi
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: https and virtual hosts problem

On 2007-05-06, egod <egoduk@NOSPAM_hotmail.com> wrote:
> http://www.acme.com - works fine
> https://www.acme.com - works fine
> http://www.example.com - works fine
>
> https://www.example.com - redirects me to https://www.acme.com!
> How do I avoid this happening?


You can define another ssl-enabled site for www.example.com and
handle it there, but you always will receive a message that the
certificate is for the wrong server. Is the way the https protocol
works. Or you could use two different IP addresses for the two
site. That would take care of everything.

Davide

--
Some drink from the Fountain of Knowledge. Others just gargle. -- Dave Aronson
And some pee in it. -- moc.oohay
  Réponse avec citation
Vieux 14/07/2007, 14h52   #3
Frederick Smith
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: https and virtual hosts problem

Davide Bianchi wrote:
> On 2007-05-06, egod <egoduk@NOSPAM_hotmail.com> wrote:
>
>>http://www.acme.com - works fine
>>https://www.acme.com - works fine
>>http://www.example.com - works fine
>>
>>https://www.example.com - redirects me to https://www.acme.com!
>>How do I avoid this happening?

>
>
> You can define another ssl-enabled site for www.example.com and
> handle it there, but you always will receive a message that the
> certificate is for the wrong server. Is the way the https protocol
> works. Or you could use two different IP addresses for the two
> site. That would take care of everything.
>
> Davide
>


The reason being that the https server doesnt know what the v1.1 http
header looks like until AFTER it has been unscrambled - which can only
be done within the defined virtual host - by which time its too late.

You might like to experiment to find out, but I think the https server
is doing what its doing because its the ONLY secure server at that
address. The results look completely predictable to me.

I read recently somewhere in the Apache documantation that its not
possible to create multiple virtual https hosts on the same machine
using the same port. So .. either buy another IP address .. or use
another port. If you want, I will try to locate the link for you

Regards


Frederick
  Réponse avec citation
Vieux 15/07/2007, 05h45   #4
Jim Hayter
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: https and virtual hosts problem

Frederick Smith wrote:
<snip>

> The reason being that the https server doesnt know what the v1.1 http
> header looks like until AFTER it has been unscrambled - which can only
> be done within the defined virtual host - by which time its too late.
>
> You might like to experiment to find out, but I think the https server
> is doing what its doing because its the ONLY secure server at that
> address. The results look completely predictable to me.
>
> I read recently somewhere in the Apache documantation that its not
> possible to create multiple virtual https hosts on the same machine
> using the same port. So .. either buy another IP address .. or use
> another port. If you want, I will try to locate the link for you
>


There is an exception to this. A wildcard certificate for *.domain.com
will enable you to do https for multiple virtual hosts on the same port.
This is because they all use the same certificate.

Jim
  Réponse avec citation
Vieux 15/07/2007, 23h20   #5
HansH
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: https and virtual hosts problem

"Jim Hayter" <see.reply.to@nowhere.invalid> schreef in bericht
news:139j9jl7ubok2dc@news.supernews.com...
>> I read recently somewhere in the Apache documantation that its not
>> possible to create multiple virtual https hosts on the same machine
>> using the same port. So .. either buy another IP address .. or use
>> another port. If you want, I will try to locate the link for you

>
> There is an exception to this. A wildcard certificate for *.domain.com
> will enable you to do https for multiple virtual hosts on the same port.
> This is because they all use the same certificate.
>

Given the domains www.acme.com and www.example.com a wildcard certificate
won't do the tric.

OP may try his luck with SubjectAltName-support
http://wiki.cacert.org/wiki/VhostTaskForce
http://www.entrust.net/ssl-products.htm
http://issues.apache.org/bugzilla/show_bug.cgi?id=34607

Might need to use mod_gnuls in stead of mod_ssl.
Might need to merge all sites into a single virtual host, by using a server
alias for each one, and revirtualize them by other means then apache
vhostting ...

HansH






  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 11h59.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,16438 seconds with 13 queries