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