Apache, Vhost, Umleitung, https, SSL-Probleme

Apache, Vhost, Umleitung, https, SSL-Probleme

Probleme:

Keine Einträge im Umschreibprotokoll zu diesen Fehlern.

vhost-Konfiguration

<VirtualHost 127.0.1.3:80>
ServerAdmin [email protected]
ServerName www.example.com

DocumentRoot /var/www/html
<Directory /var/www/html>
    Options Indexes FollowSymLinks
    AllowOverride All


    Order allow,deny
    Allow from all
</Directory>


Redirect permanent /fundprocess.html https://example.com/fundprocess.html
Redirect permanent /fund_process.php https://example.com/fund_process.php

ErrorLog /var/log/apache2/example.com-error_log
TransferLog /var/log/apache2/example.com-access_log
LogLevel warn

RewriteLog /var/log/apache2/example.com-rewrite_log
RewriteLogLevel 9



</VirtualHost>


<VirtualHost 127.0.1.2:80>
ServerAdmin [email protected]
ServerName example.com
DocumentRoot /var/www/html

    RewriteCond %{REQUEST_URI} !fundprocess.html [NC]
    RewriteCond %{REQUEST_URI} !fund_process.php [NC]
    RewriteRule (.*) http://www.example.com/$1 [R=301,L]

    RewriteCond %{REQUEST_URI} fundprocess.html [NC]
    RewriteCond %{REQUEST_URI} fund_process.php [NC]
    RewriteRule (.*) https://example.com/$1 [R=301,L]



</VirtualHost>



<VirtualHost 127.0.1.3:443>
ServerAdmin [email protected]
ServerName www.example.com
DocumentRoot /var/www/html

    RewriteCond %{REQUEST_URI} !fundprocess.html [NC]
    RewriteCond %{REQUEST_URI} !fund_process.php [NC]
    RewriteRule (.*) http://www.example.com/$1 [R=301,L]

    RewriteCond %{REQUEST_URI} fundprocess.html [NC]
    RewriteCond %{REQUEST_URI} fund_process.php [NC]
    RewriteRule (.*) https://example.com/$1 [R=301,L]


</VirtualHost>



<VirtualHost 127.0.1.2:443>
ServerAdmin [email protected]
ServerName example.com


DocumentRoot /var/www/html
<Directory /var/www/html>

    Options Indexes FollowSymLinks
    AllowOverride All


    Order allow,deny
    Allow from all

 </Directory>


RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !fundprocess.html [NC]
RewriteCond %{REQUEST_URI} !fund_process.php [NC]
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

ErrorLog /var/log/apache2/example.com-ssl-error_log
TransferLog /var/log/apache2/example.com-ssl-access_log
LogLevel warn

RewriteLog /var/log/apache2/example.com-rewrite_log
RewriteLogLevel 9


SSLEngine On
SSLCertificateFile /etc/certs/example.crt
SSLCertificateKeyFile /etc/certs/example.key


SetEnvIf User-Agent ".*MSIE.*" \
         nokeepalive ssl-unclean-shutdown \
         downgrade-1.0 force-response-1.0

</VirtualHost>

Antwort1

Dies ist kein Problem mit der Weiterleitung, sondern ein Problem mit dem SSL (die Anforderung muss entschlüsselt werden, bevor die Weiterleitung stattfindet).

Haben Sie Listen 443irgendwo in Ihrer Apache-Konfiguration einen Eintrag? Wenn nicht, fügen Sie ihn in der Nähe des Listen 80-Teils ein. Betreiben Sie andere SSL-Websites auf diesem Server? Stellen Sie sicher, dass sie nicht dieselbe IP-Adresse verwenden. Wenn Sie ein SSL-Zertifikat haben, das woanders funktioniert, versuchen Sie, es für diese Site zu verwenden. Im Browser wird eine Warnung angezeigt, aber wenn Sie die Warnung akzeptieren, sollte eine Umleitung erfolgen. Dann wissen Sie, dass das Problem bei Ihrem SSL-Zertifikat liegt.

Antwort2

ssl_error_rx_record_too_long tritt auf, wenn Apache SSL erwartet und http empfängt.

Stellen Sie sicher, dass alle Anfragen über Port 443 an einen virtuellen Host mit gelangen SSLEngine On. Sie müssen Ihr Problem beheben <VirtualHost 127.0.1.3:443>.

Außerdem muss Ihr Zertifikat sowohl für example.com als auch für *.example.com funktionieren. Andernfalls erhalten Ihre Clients keine Weiterleitung, sondern unschöne Warnungen.

verwandte Informationen