Problem mit VirtualHosts in Verbindung mit SSL

Alles, was den Apache betrifft, kann hier besprochen werden.

Problem mit VirtualHosts in Verbindung mit SSL

Postby michiwinkler » 15. June 2007 17:23

Hallo *

Folgende Ausgangslage habe ich bezüglich Konfiguration:

Mittels untem aufgeführten VirtualHost Container sind die verschiedenen Domains konfiguriert.

Code: Select all
<VirtualHost *:80>
        ServerAdmin webmaster@domain.local
        ServerName domain.local
        ServerAlias www.domain.local

        DocumentRoot /home/win/websites/files/domain.local/

        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>

        <Directory /home/win/websites/files/domain.local/>
                Options -Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
                # This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
                # RedirectMatch ^/$ /apache2-default/
        </Directory>

        ErrorLog /var/log/apache2/error.log

        LogLevel warn

        CustomLog /var/log/apache2/access.log combined
        ServerSignature Off

</VirtualHost>



Dazu existiert dieser VirtualHost noch:
(Dies wird angewendet wenn für eine Domain nichts konfiguriert wurde, denke ich)

Code: Select all
<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www/
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options -Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
                # This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
                RedirectMatch ^/$ /apache2-default/
        </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 /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined
        ServerSignature On

    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>

</VirtualHost>


Nun habe ich mittels folgender Container einen "HTTPS VirtualHost" erstellt:

Code: Select all
<VirtualHost *:443>

        ServerName www.ssldomain.local

        DocumentRoot /home/win/websites/files/ssldomain.local/

        SSLEngine On
        SSLCertificateFile /home/win/certs/ssldomain.local.cert
        SSLCertificateKeyFile /home/win/certs/ssldomain.local.key


        <Directory /home/win/websites/files/ssldomain.local/>
                Options -Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ServerSignature Off

</VirtualHost>


Die oben beschriebene Konfiguration funktioniert ohne Probleme aber wenn ich nun eine andere Domain über https aufrufe leitet er mich immer zum oben genannten Container weiter. Das heisst ich habe für alle Domains https aktiviert obwohl ich oben mit
Code: Select all
ServerName www.ssldomain.local

nur eine bestimmte Domain eingetragen habe.

Wie muss ich Apache konfigurieren damit https nur bei ausgewählten Domains aktiviert ist.


Danke und Gruss
michiwinkler
 
Posts: 1
Joined: 15. June 2007 09:46

Postby meutrich » 16. June 2007 09:50

Hm...in der Doku steht unter "Namensbasierte gegenüber IP-basierten virtuellen Hosts"
Namensbasierte virtuelle Hosts können aufgrund der Natur des SSL-Protokolls nicht mit SSL-gesicherten Servern verwendet werden.


Somit meine ich, das SSL nur mit ipbasierten Virtuellen Hosts geht.
meutrich
 
Posts: 4
Joined: 12. June 2007 16:50


Return to Apache

Who is online

Users browsing this forum: No registered users and 27 guests