henere
Goto Top

Probleme mit Apache2 beim Versuch auf SSL umzustellen

Hallo zusammen,

Umgebung Apache2 unter Ubuntu 14.04 LTS

Ich habe gestern mich mit Lets Encrypt beschäftigt.
Ziel ist es, 6 auf dem gleichen Server gehosteten Domains jeweils nur noch per HTTPS zugänglich zu machen.

Für die erste Domain hat das wunderbar geklappt.

Bei der zweiten Domain habe ich dann auch die Zertifikate von der Test-CA geholt und die .conf in /etc/apache2/sites-available angepasst. Danach den Apachen neu gestartet mit service apache2 restart. Doch nun kommt ein größeres Problem, was ich nicht verstehe.

Wenn ich die URL der zweiten Domain im Browser aufrufe, so wird mir der Inhalt der ersten Domain ausgeliefert ???
Da ich nur die Test-CA von lets Encrypt verwende, ist dieser Fehler hier ok: Certificate Error
There are issues with the site's certificate chain (net::ERR_CERT_COMMON_NAME_INVALID).

Setze ich die Config auf nur HTTP zurück, dann bekomme ich den richtigen Content ausgeliefert.

Wo hab ich meinen Fehler ?

root@www:/etc/apache2/sites-available# more domainname2.conf
<VirtualHost *:80>
        ServerAdmin info@meinedomain.de
        ServerName www.domainname2.de
        Redirect permanent / https://www.domainname2.de/
        DocumentRoot /var/www/html/domainname2
        <Directory /var/www/html/domainname2>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                #Order allow,deny
                #allow from all
                Require all granted
        </Directory>
        ErrorLog /var/log/apache2/error-domainname2.log
        LogLevel warn
        CustomLog /var/log/apache2/access-domainname2.log combined
        ServerSignature On
</VirtualHost>

<VirtualHost *:443>
    SSLEngine on
    SSLCertificateFile /etc/getssl/working/www.domainname2.de/www.domainname2.de.crt
    SSLCertificateKeyFile /etc/getssl/working/www.domainname2.de/www.domainname2.de.key

    # Pfad zu den Webinhalten
    DocumentRoot /var/www//html/domainname2
        <Directory /var/www/html/domainname2>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                #Order allow,deny
                #allow from all
                Require all granted
        </Directory>
        ErrorLog /var/log/apache2/error-domainname2.log
        LogLevel warn
        CustomLog /var/log/apache2/access-domainname2.log combined
        ServerSignature On
</VirtualHost>

Danke und Grüße, Henere

Content-Key: 308701

Url: https://administrator.de/contentid/308701

Printed on: April 18, 2024 at 04:04 o'clock

Member: Chonta
Solution Chonta Jul 01, 2016 at 13:39:46 (UTC)
Goto Top
Hallo,

für den 443 Teil fehlt der Servername.

Gruß

Chonta
Mitglied: 129813
Solution 129813 Jul 01, 2016 updated at 13:45:05 (UTC)
Goto Top
And additionally you can find one doubled slash here:
DocumentRoot /var/www//html/domainname2
But main problem is what Chonta said, the missing ServerName directive.

Regards
Member: Henere
Henere Jul 01, 2016 updated at 14:06:29 (UTC)
Goto Top
Danke, das wars. Und ich hab mich wundgesucht.
Bei dem Domain1 war klar, das es geht, da er wohl das erste genommen hat, was er zu 443 gefunden hat und das wurde dann default für ihn.

Danke Dir. Henere
Member: Henere
Henere Jul 01, 2016 at 14:05:39 (UTC)
Goto Top
Thx, it is corrected, but it worked also with the double slashes.

Henere
Mitglied: 129813
129813 Jul 01, 2016 updated at 14:13:27 (UTC)
Goto Top
Zitat von @Henere:

Thx, it is corrected, but it worked also with the double slashes.
That's all right because multiple consecutive slashes result in one, but there is one exception, namely if they are at the beginning of the path, then they can be interpreted differently.