Problem mit Letsencrypt auf Wordpress Site

tsk

Member
Hallo zusammen,

ich habe ein Problem mit der Erneuerung von Letsencrypt Zertifikaten auf einer Wordpress Installation. Dies muss an meiner derzeitigen Apache Konfiguration liegen, denn vor der Installation von Wordpress funktionierte die Erstausstellung wie auch per dry-run ausgeführte Erneuerungen.

Der wahrscheinlich relevante Teil des virtual host (domain anonymisiert):

Code:
<IfModule mod_ssl.c>
    <VirtualHost *:443>
        ServerName www.mydomain.test
        ServerAlias smtp.mydomain.test imap.mydomain.test pop.mydomain.test mydomain.test zeus.mydomain.test
	DocumentRoot /var/www/mydomain/public_html
	. . .
	. . .
	. . . 
        <Directory "/var/www/mydomain/public_html/.well-known">
            Options -Indexes
            Require all granted
        </Directory>

        <Directory "/var/www/mydomain/public_html">
            Require all granted
            DirectoryIndex index.php
            AllowOverride FileInfo
            Options FollowSymLinks
            FallbackResource /index.php
            # Deny access to No-Referrer Requests
            # (Spam Bots which don't use comment form)
            <IfModule mod_rewrite.c>
                 RewriteCond %{REQUEST_METHOD} POST
                 RewriteCond %{REQUEST_URI} .wp-comments-post\.php*
                 RewriteCond %{HTTP_REFERER} !.*mydomain.test.* [OR]
                 RewriteCond %{HTTP_USER_AGENT} ^$
                 RewriteRule (.*) http://%{REMOTE_ADDR}/$ [R=301,L]
            </IfModule>
        </Directory>
. . .

Bei Zugriff des certbot auf .well-known erfolgt ein 403. Lege ich unter .well-known (derzeit chmod 775) eine Testdatei an, so kann ich sie im Browser aufrufen. Jetzt geht mir die Puste aus, und meine Zertifikate laufen zeitnah aus.

Ein dry-run bei der Zertifikatserneuerung führt hierzu (nur der Teil mit den Fehlern)
Code:
Attempting to renew cert from /etc/letsencrypt/renewal/mydomain.test.conf produced an unexpected error: Failed authorization procedure. mydomain.test (http-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Could not connect to www.mydomain.test.well-known, maximus.mydomain.test (http-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Could not connect to maximus.mydomain.test.well-known, imap.mydomain.test (http-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Could not connect to www.mydomain.test.well-known, zeus.mydomain.test (http-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Could not connect to www.mydomain.test.well-known, smtp.mydomain.test (http-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Could not connect to www.mydomain.test.well-known, www.mydomain.test (http-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Could not connect to www.mydomain.test.well-known, pop.mydomain.test (http-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Could not connect to www.mydomain.test.well-known. Skipping.

Langsam wächst die Panik. Wäre für jede Unterstützung dankbar.
 
maximus.mydomain.test wird nicht vom Apache ausgeliefert.

Edit: Existieren entsprechende http-->https Weiterleitungen? Oder ist der .well-known Ordner auch unter http erreichbar?
 
Last edited by a moderator:
Die maximus subdomain soll nicht immer aktiv sein. Ursprünglich war sie für rein administrative Zwecke gedacht. Sie wird vom Renew script gestartet, und danach wieder disabled.

Code:
./certbot-auto renew --dry-run --keep-until-expiring --pre-hook "a2ensite maximus.mydomain.test-ssl && systemctl reload apache2" --post-hook "a2dissite maximus.mydomain.test-ssl && systemctl reload apache2"

Die Default Site www.mydomain.test ist ssl-only. Von der non-www Site erfolgt ein permanenter Redirect auf die Default (ssl) Site

EDIT: ich habe die maximus subdomain zum Test permanent aktiviert. Gleiches Ergebnis.
 
Last edited by a moderator:
Der Meldungsteil http-01 weist darauf hin, dass die Domain nicht per http erreichbar ist.
Der LE client will das aber.
 
uff - das würde es erklären. Ich habe überall Redirects von http auf https. Wie gehe ich denn damit am besten um, wenn ich keine non-ssl Sites will?
 
Holy Cow: Die Lösung war viel banaler. Um https überall zu erzwingen hatte ich auf Port 80 folgendes:

Code:
<VirtualHost *:80>
       ServerName mydomain.test
       Redirect permanent / https://www.mydomain.test
</VirtualHost>

<VirtualHost *:80>
       ServerName www.mydomain.test
       Redirect permanent / https://www.mydomain.test
</VirtualHost>

Man beachte den fehlenden "/" hinter der Domain. Ich Depp, ich.
 
Back
Top