Apache SSL Redirect von domain.de auf www.domain.de

Irgendwelche Probleme mit XAMPP für Windows? Dann ist hier genau der richtige Ort um nachzufragen.

Apache SSL Redirect von domain.de auf www.domain.de

Postby haemm1 » 19. August 2008 10:47

Hi Leute.
Ich hab ein kleines Problem.

Ich hab ein echtes Zertifikat für eine Domain.
Nennen wir sie mal https://www.domain.de

Jetzt möchte ich alle Anfragen von https://domain.de auf die https://www.domain.de umleiten, krieg es aber nicht gebacken.

Der Virtualhost Redirect Befehl funktioniert einwandfrei unter http, sprich Port 80. Aber mit ssl Port 443 geht es nicht. Warum?

Könnt ihr mir helfen?

Greetz
haemm1
 
Posts: 13
Joined: 19. August 2008 10:40

Postby Nobbie » 19. August 2008 11:04

>Der Virtualhost Redirect Befehl funktioniert einwandfrei unter http, sprich Port 80. Aber mit ssl Port 443 geht es nicht. Warum?

Keine Ahnung - wie sieht er denn aus?
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Postby haemm1 » 19. August 2008 11:11

//Funktioniert
<VirtualHost *:80>
ServerName domain1.de
ServerAlias www.domain2.de domain2.de
Redirect / http://www.domain.de/
</VirtualHost>


//Funktioninert nicht
<VirtualHost *:443>
ServerName domain1.de:443
ServerAlias www.domain2.de:443 domain2.de:443
Redirect / https://www.domain.de/
</VirtualHost>
haemm1
 
Posts: 13
Joined: 19. August 2008 10:40

Postby Nobbie » 19. August 2008 11:46

Ist das die ganze vhost Konfiguration?
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Postby haemm1 » 19. August 2008 12:13

nein natürlich nicht, aber das ist der entscheidende teil
haemm1
 
Posts: 13
Joined: 19. August 2008 10:40

Postby deepsurfer » 19. August 2008 12:25

haemm1 wrote:nein natürlich nicht, aber das ist der entscheidende teil


Nein eben nicht, es geht auch um die <Directory> Container in deiem VHOST.

Poste bitte für die Domänen den kompletten VHOST aufbau, explizite Domainnamen kannst du gegen DUMMYnamen austauschen.
Aber entscheidend ist der komplette VHOST, denn daran sieht man erst ob DU überhaupt richtig liegst.
chirio Deep
Wie sagte einst der MCP aus Tron auf dem Bildschirm zu schreiben Pflegte
" ... end of communication ... "
User avatar
deepsurfer
AF Moderator
 
Posts: 6440
Joined: 23. November 2004 10:44
Location: Cologne
Operating System: Win-XP / Win7 / Linux -Debian

Postby haemm1 » 19. August 2008 12:47

na gut, das sind aber ein paar zeilen...

zuerst der http-teil (Port 80) der problemlos funktioniert:

NameVirtualHost *:80

###### die drei Haupt-Directiven #######
<VirtualHost *:80>
DocumentRoot "D:/Pfad/domain1"
ServerName www.domain1.de
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "D:/Pfad/domain2"
ServerName www.domain2.de
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "D:/Pfad/domain3"
ServerName www.domain3.de
</VirtualHost>

####### Domain - Weiterleitungen #######
<VirtualHost *:80>
ServerName domain1.de
ServerAlias www.domain1a.de domain1a.de
ServerAlias www.domain1b.de domain1b.de
Redirect / http://www.domain1.de/
</VirtualHost>

<VirtualHost *:80>
ServerName domain2.de
ServerAlias www.domain2a.de domain2a.de
ServerAlias www.domain2b.de domain2b.de
Redirect / http://www.domain2.de/
</VirtualHost>

<VirtualHost *:80>
ServerName domain3.de
ServerAlias www.domain3a.de domain3a.de
ServerAlias www.domain3b.de domain3b.de
Redirect / http://www.domain3.de/
</VirtualHost>



jetzt der https-teil (Port 443) der nicht funktioniert:

NameVirtualHost *:443

###### die drei SSL Haupt-Directiven #######
<VirtualHost *:443>
DocumentRoot "D:/Pfad/domain1"
ServerName www.domain1.de:443
ServerAdmin admin@localhost

ErrorLog logs/error.log
<IfModule log_config_module>
CustomLog logs/access.log combined
</IfModule>

SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

SSLCertificateFile conf/ssl.crt/ssl_normal.crt
SSLCACertificateFile conf/ssl.crt/ssl_sgc.crt
SSLCertificateKeyFile conf/ssl.key/server.key


<FilesMatch "\.(cgi|shtml|phtml|php|php5|php4|php3)$">
SSLOptions +StdEnvVars
</FilesMatch>

<IfModule setenvif_module>
BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
</IfModule>

<IfModule log_config_module>
CustomLog logs/ssl_request.log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</IfModule>
</VirtualHost>


<VirtualHost *:443>
DocumentRoot "D:/Pfad/domain2"
ServerName www.domain2.de:443
ServerAdmin admin@localhost

ErrorLog logs/error.log
<IfModule log_config_module>
CustomLog logs/access.log combined
</IfModule>

SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

SSLCertificateFile conf/ssl.crt/ssl_normal.crt
SSLCACertificateFile conf/ssl.crt/ssl_sgc.crt
SSLCertificateKeyFile conf/ssl.key/server.key


<FilesMatch "\.(cgi|shtml|phtml|php|php5|php4|php3)$">
SSLOptions +StdEnvVars
</FilesMatch>

<IfModule setenvif_module>
BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
</IfModule>

<IfModule log_config_module>
CustomLog logs/ssl_request.log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</IfModule>
</VirtualHost>

<VirtualHost *:443>
DocumentRoot "D:/Pfad/domain3"
ServerName www.domain3.de:443
ServerAdmin admin@localhost

ErrorLog logs/error.log
<IfModule log_config_module>
CustomLog logs/access.log combined
</IfModule>

SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

SSLCertificateFile conf/ssl.crt/ssl_normal.crt
SSLCACertificateFile conf/ssl.crt/ssl_sgc.crt
SSLCertificateKeyFile conf/ssl.key/server.key


<FilesMatch "\.(cgi|shtml|phtml|php|php5|php4|php3)$">
SSLOptions +StdEnvVars
</FilesMatch>

<IfModule setenvif_module>
BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
</IfModule>

<IfModule log_config_module>
CustomLog logs/ssl_request.log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</IfModule>
</VirtualHost>

####### SSL - Domain - Weiterleitungen #######
<VirtualHost *:443>
ServerName domain1.de:443
ServerAlias www.domain1a.de:443 domain1a.de:443
ServerAlias www.domain1b.de:443 domain1b.de:443
Redirect / https://www.domain1.de/
</VirtualHost>

<VirtualHost *:443>
ServerName domain2.de:443
ServerAlias www.domain2a.de:443 domain2a.de:443
ServerAlias www.domain2b.de:443 domain2b.de:443
Redirect / https://www.domain2.de/
</VirtualHost>

<VirtualHost *:443>
ServerName domain3.de:443
ServerAlias www.domain3a.de:443 domain3a.de:443
ServerAlias www.domain3b.de:443 domain3b.de:443
Redirect / https://www.domain3.de/
</VirtualHost>


wenn ich jetzt z.B. http://www.domain2b.de aufrufe, werde ich auf http://www.domain2.de weitergeleitet. so solls sein.

wenn ich aber z. B. https://www.domain2b.de aufrufe, werde ich nicht weitergeleitet. die domain bleibt einfach stehen.
haemm1
 
Posts: 13
Joined: 19. August 2008 10:40

Postby deepsurfer » 19. August 2008 12:59

Ok..also benutzt Du einen Globalen <Directory> Container für alle Domains damit die Deny Berechtigungen gesetzt sind.

Bei SSL VHOST gibt es eine Einschränkung....
Ich mein mich zu erinnern das entweder eine IP oder Domainname bei *:443 stehen muss (z.b. 127.0.0.1:443 / Dname:443)

zudem muss zu jedem Domainnamen ein eigener SSL Schlüssel generiert werden dessen Pfad in dem <Directory> Container des SSL-VHOST definiert wird.

Muss mich aber dafür auch nochmal einlesen, denke da wird sich gleich noch ein SSL-VHOST Guru melden.
chirio Deep
Wie sagte einst der MCP aus Tron auf dem Bildschirm zu schreiben Pflegte
" ... end of communication ... "
User avatar
deepsurfer
AF Moderator
 
Posts: 6440
Joined: 23. November 2004 10:44
Location: Cologne
Operating System: Win-XP / Win7 / Linux -Debian

Postby glitzi85 » 19. August 2008 15:56

deepsurfer wrote:explizite Domainnamen kannst du gegen DUMMYnamen austauschen.

Noch besser: http://tools.ietf.org/html/rfc2606
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Postby deepsurfer » 19. August 2008 16:40

Oh jaaa, ich vergass ;-)

Wenn Du Deine VHOST Postet und Du nicht möchtest das man aufgrund dieses Posting in Geheimnisse deines Server einblick erhält, so ändere explizite Domainnamen in die RFC konforme Schreibweise um.
Damit haben dann alle Administratoren keine Probleme genau zu verstehen was Du hier postet und auch die Suchmaschinen breiten dann Dein Posting nicht mit originalen Dnamen aus. (was wohl mitunter die beste Werbung wäre *g*)
chirio Deep
Wie sagte einst der MCP aus Tron auf dem Bildschirm zu schreiben Pflegte
" ... end of communication ... "
User avatar
deepsurfer
AF Moderator
 
Posts: 6440
Joined: 23. November 2004 10:44
Location: Cologne
Operating System: Win-XP / Win7 / Linux -Debian


Return to XAMPP für Windows

Who is online

Users browsing this forum: CptEureka and 20 guests