I have an issue with the letsencrypt certificate. When I get the certificate via the ncp admin panel it does not work for my domain.
First I followed this guide How to get certificate with Letsencrypt using DNS to verify domain because getting the certificate via ncp admin panel did not worked. After that I could execute it (logs attached).
I use NCP version 1.55.3 with Raspberry Pie 5.
There must be something wrong with my configuration but I can not find it. Can anybody help?
If I curl myExternalIP I get the right certificate:
* Server certificate:
* subject: CN=nc.myDomain.tld
* start date: Jan 26 07:12:08 2025 GMT
* expire date: Apr 26 07:12:07 2025 GMT
* issuer: C=US; O=Let's Encrypt; CN=E5
* SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
* Using HTTP2, server supports multiplexing
But if I curl nc.myDomain.tld I get the wrong one
* Server certificate:
* subject: CN=nc.myDomain.tld
* start date: Jan 1 00:01:13 1970 GMT
* expire date: Jan 16 00:01:13 2038 GMT
* issuer: CN=nc.myDomain.tld
* SSL certificate verify result: self signed certificate (18), continuing anyway.
> GET / HTTP/1.1
The curious thing is that somehow the page I get back is from my FritzBox. (This comes with curl nc.myDomain.tld
<!DOCTYPE html>
<html lang="de">
<head>
.
.
.
<title>
FRITZ!Box
</title>
</head>
npc.log:
Installing template 'nextcloud.conf.sh'...
INFO: Letsencrypt domain is nc.myDomain.tld
INFO: Metrics enabled: no
Apache self check:
Syntax OK
System config value trusted_domains => 11 set to string nc.myDomain.tld
System config value trusted_domains => 3 set to string nc.myDomain.tld
System config value overwrite.cli.url set to string https://nc.myDomain.tld/
System config value trusted_proxies => 11 set to string 127.0.0.1
System config value trusted_proxies => 12 set to string ::1
System config value trusted_proxies => 14 set to string myExternalIP
Setup notify_push (attempt 1/5)
âś“ redis is configured
đź—´ can't connect to push server: Client error: `GET https://nc.myDomain.tld/push/test/cookie` resulted in a `404 Not Found` response:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv=content-type content="text/html; charset=utf-8" />
<meta http-e (truncated...)
Setup notify_push (attempt 5/5)
âś“ redis is configured
đź—´ can't connect to push server: Client error: `GET https://nc.myDomain.tld/push/test/cookie` resulted in a `404 Not Found` response:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv=content-type content="text/html; charset=utf-8" />
<meta http-e (truncated...)
letsencrypt.log
2025-01-26 08:10:40,869:DEBUG:acme.client:Storing nonce: KY2mD_AjpWQtXx94MS59a4GAgD_d2z2WA3I6t-3lur1KuRluOsc
2025-01-26 08:10:40,871:DEBUG:certbot._internal.storage:Writing new private key to /etc/letsencrypt/archive/nc.myDomain.tld/privkey8.pem.
2025-01-26 08:10:40,871:DEBUG:certbot._internal.storage:Writing certificate to /etc/letsencrypt/archive/nc.myDomain.tld/cert8.pem.
2025-01-26 08:10:40,871:DEBUG:certbot._internal.storage:Writing chain to /etc/letsencrypt/archive/nc.myDomain.tld/chain8.pem.
2025-01-26 08:10:40,872:DEBUG:certbot._internal.storage:Writing full chain to /etc/letsencrypt/archive/nc.myDomain.tld/fullchain8.pem.
2025-01-26 08:10:40,872:DEBUG:certbot._internal.cli:Var authenticator=webroot (set by user).
2025-01-26 08:10:40,872:DEBUG:certbot._internal.cli:Var webroot_path=/var/www/nextcloud (set by user).
2025-01-26 08:10:40,873:DEBUG:certbot._internal.cli:Var webroot_path=/var/www/nextcloud (set by user).
2025-01-26 08:10:40,873:DEBUG:certbot._internal.cli:Var webroot_map={'webroot_path'} (set by user).
2025-01-26 08:10:40,873:DEBUG:certbot._internal.storage:Writing new config /etc/letsencrypt/renewal/nc.myDomain.tld.conf.new.
2025-01-26 08:10:40,875:INFO:certbot.compat.misc:Running deploy-hook command: /etc/letsencrypt/renewal-hooks/deploy/ncp
2025-01-26 08:10:42,625:DEBUG:certbot._internal.display.obj:Notifying user:
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/nc.myDomain.tld/fullchain.pem
Key is saved at: /etc/letsencrypt/live/nc.myDomain.tld/privkey.pem
This certificate expires on 2025-04-26.
/etc/apache2/sites-enabled/000-default.conf
<VirtualHost _default_:80>
DocumentRoot /var/www/nextcloud
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^.well-known/acme-challenge/ - [L]
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
</IfModule>
<Directory /var/www/nextcloud/>
Options +FollowSymlinks
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
LimitRequestBody 0
</Directory>
</VirtualHost>
/etc/apache2/sites-enabled/001-nextcloud.conf:
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
DocumentRoot /var/www/nextcloud
ServerName nc.myDomain.tld
CustomLog /var/log/apache2/nc-access.log combined
ErrorLog /var/log/apache2/nc-error.log
SSLEngine on
SSLProxyEngine on
SSLCertificateFile /etc/letsencrypt/live/nc.myDomain.tld/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/nc.myDomain.tld/privkey.pem
# For notify_push app in NC21
ProxyPass /push/ws ws://127.0.0.1:7867/ws
ProxyPass /push/ http://127.0.0.1:7867/
ProxyPassReverse /push/ http://127.0.0.1:7867/
</VirtualHost>
ls -lah /etc/letsencrypt/live/nc.myDomain.tld/
total 12K
drwxr-xr-x 2 root root 4.0K Jan 26 08:10 .
drwxrwxr-x 3 root root 4.0K Oct 15 12:16 ..
lrwxrwxrwx 1 root root 48 Jan 26 08:10 cert.pem -> ../../archive/nc.myDomain.tld/cert8.pem
lrwxrwxrwx 1 root root 49 Jan 26 08:10 chain.pem -> ../../archive/nc.myDomain.tld/chain8.pem
lrwxrwxrwx 1 root root 53 Jan 26 08:10 fullchain.pem -> ../../archive/nc.myDomain.tld/fullchain8.pem
lrwxrwxrwx 1 root root 51 Jan 26 08:10 privkey.pem -> ../../archive/nc.myDomain.tld/privkey8.pem
/etc/apache2/sites-enabled/nextcloud.conf
array (
0 => 'nc.myDomain.tld',
2 => 'localhost',
7 => 'nextcloudpi',
5 => 'nextcloudpi.local',
8 => 'nextcloudpi.lan',
3 => 'nc.myDomain.tld',
11 => 'nc.myDomain.tld',
1 => '192.168.178.35',
14 => 'nextcloudpi',
20 => 'nc.myDomain.tld',
21 => '192.168.178.35',
22 => 'myExternalIP',