Certificate deleted / apache down / connection refused

Hi,
I had a working installation of
Odroid - NAS / armbian
ncp version 1.26.0
nextcloud 18.0.5.1

A router change (and ME!!) crashed my installation. I know the problem, but not the right steps to resolve it:

  1. With my new router (Fritz!box) a new dynamic DNS address is assigned.
  2. letsencrypt certificate renewal failed (of course)
  3. I deleted the certificate with cerbot /deletebecause of a hint in a forum article here.
  4. now apache server is down, because I have no certificate, but the old certificate is still in the ncp.conf file.
  5. re-installation of apache service doesn’t help:
    sudo apt-get update
    sudo apt-get install --reinstall apache2
    sudo apt-get install libapache2-mod-authnz-external
    sudo apt-get install libapache2-mod-security2

This is the end of my knowledge :slight_smile: WHAT IS THE SOLUTION?

This is the important output of ‘journalctl -xe’:
Jul 26 10:19:15 nextcloudpi systemd[1]: Starting The Apache HTTP Server…
– Subject: A start job for unit apache2.service has begun execution
– Defined-By: systemd
– Support: https://www.debian.org/support

– A start job for unit apache2.service has begun execution.

– The job identifier is 3380.
Jul 26 10:19:16 nextcloudpi apachectl[25806]: AH00526: Syntax error on line 5 of /etc/apache2/sites-enabled/ncp.conf:
Jul 26 10:19:16 nextcloudpi apachectl[25806]: SSLCertificateFile: file ‘/etc/letsencrypt/live/hmbxfo4t8rmmko4d.myfrit
Jul 26 10:19:16 nextcloudpi apachectl[25806]: Action ‘start’ failed.
Jul 26 10:19:16 nextcloudpi apachectl[25806]: The Apache error log may have more information.
Jul 26 10:19:16 nextcloudpi systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
– Subject: Unit process exited
– Defined-By: systemd
– Support: https://www.debian.org/support

– An ExecStart= process belonging to unit apache2.service has exited.

– The process’ exit code is ‘exited’ and its exit status is 1.
Jul 26 10:19:16 nextcloudpi systemd[1]: apache2.service: Failed with result ‘exit-code’.
– Subject: Unit failed
– Defined-By: systemd
– Support: https://www.debian.org/support

– The unit apache2.service has entered the ‘failed’ state with result ‘exit-code’.
Jul 26 10:19:16 nextcloudpi systemd[1]: Failed to start The Apache HTTP Server.
– Subject: A start job for unit apache2.service has failed
– Defined-By: systemd
– Support: https://www.debian.org/support

– A start job for unit apache2.service has finished with a failure.

– The job identifier is 3380 and the job result is failed.
Jul 26 10:19:16 nextcloudpi sudo[25803]: pam_unix(sudo:session): session closed for user root
…skipping…
Jul 26 10:16:41 nextcloudpi systemd[1]: Started User Manager for UID 0.
– Subject: A start job for unit user@0.service has finished successfully
– Defined-By: systemd
– Support: https://www.debian.org/support

– A start job for unit user@0.service has finished successfully.

– The job identifier is 3267.
Jul 26 10:16:41 nextcloudpi NetworkManager[647]: ((src/settings/nm-settings-connection.c:361)): assertion ‘’
Jul 26 10:16:41 nextcloudpi systemd[1]: Started Session 414 of user root.
– Subject: A start job for unit session-414.scope has finished successfully
– Defined-By: systemd
– Support: https://www.debian.org/support

– A start job for unit session-414.scope has finished successfully.

– The job identifier is 3323.
Jul 26 10:16:41 nextcloudpi NetworkManager[647]: ((src/settings/nm-settings-connection.c:361)): assertion ‘’
Jul 26 10:16:41 nextcloudpi NetworkManager[647]: ((src/settings/nm-settings-connection.c:361)): assertion ‘’
Jul 26 10:16:41 nextcloudpi NetworkManager[647]: ((src/settings/nm-settings-connection.c:361)): assertion ‘’
Jul 26 10:16:42 nextcloudpi sshd[25619]: Starting session: shell on pts/0 for root from 192.168.178.20 port 55948 id
Jul 26 10:17:01 nextcloudpi CRON[25763]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 26 10:17:01 nextcloudpi CRON[25764]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Jul 26 10:17:01 nextcloudpi CRON[25763]: pam_unix(cron:session): session closed for user root
Jul 26 10:19:15 nextcloudpi sudo[25803]: root : TTY=pts/0 ; PWD=/root ; USER=root ; COMMAND=/bin/systemctl start
Jul 26 10:19:15 nextcloudpi sudo[25803]: pam_unix(sudo:session): session opened for user root by root(uid=0)
Jul 26 10:19:15 nextcloudpi systemd[1]: Starting The Apache HTTP Server…
– Subject: A start job for unit apache2.service has begun execution
– Defined-By: systemd
– Support: https://www.debian.org/support

– A start job for unit apache2.service has begun execution.

– The job identifier is 3380.
Jul 26 10:19:16 nextcloudpi apachectl[25806]: AH00526: Syntax error on line 5 of /etc/apache2/sites-enabled/ncp.conf:
Jul 26 10:19:16 nextcloudpi apachectl[25806]: SSLCertificateFile: file ‘/etc/letsencrypt/live/hmbxfo4t8rmmko4d.myfrit
Jul 26 10:19:16 nextcloudpi apachectl[25806]: Action ‘start’ failed.
Jul 26 10:19:16 nextcloudpi apachectl[25806]: The Apache error log may have more information.
Jul 26 10:19:16 nextcloudpi systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
– Subject: Unit process exited
– Defined-By: systemd
– Support: https://www.debian.org/support

– An ExecStart= process belonging to unit apache2.service has exited.

– The process’ exit code is ‘exited’ and its exit status is 1.
Jul 26 10:19:16 nextcloudpi systemd[1]: apache2.service: Failed with result ‘exit-code’.
– Subject: Unit failed
– Defined-By: systemd
– Support: https://www.debian.org/support

– The unit apache2.service has entered the ‘failed’ state with result ‘exit-code’.
Jul 26 10:19:16 nextcloudpi systemd[1]: Failed to start The Apache HTTP Server.
– Subject: A start job for unit apache2.service has failed
– Defined-By: systemd
– Support: https://www.debian.org/support

– A start job for unit apache2.service has finished with a failure.

– The job identifier is 3380 and the job result is failed.
Jul 26 10:19:16 nextcloudpi sudo[25803]: pam_unix(sudo:session): session closed for user root
lines 1782-1842/1842 (END)
Jul 26 10:16:41 nextcloudpi systemd[1]: Started User Manager for UID 0.
– Subject: A start job for unit user@0.service has finished successfully
– Defined-By: systemd
– Support: https://www.debian.org/support

– A start job for unit user@0.service has finished successfully.

– The job identifier is 3267.
Jul 26 10:16:41 nextcloudpi NetworkManager[647]: ((src/settings/nm-settings-connection.c:361)): assertion ‘’ failed
Jul 26 10:16:41 nextcloudpi systemd[1]: Started Session 414 of user root.
– Subject: A start job for unit session-414.scope has finished successfully
– Defined-By: systemd
– Support: https://www.debian.org/support

– A start job for unit session-414.scope has finished successfully.

– The job identifier is 3323.
Jul 26 10:16:41 nextcloudpi NetworkManager[647]: ((src/settings/nm-settings-connection.c:361)): assertion ‘’ failed
Jul 26 10:16:41 nextcloudpi NetworkManager[647]: ((src/settings/nm-settings-connection.c:361)): assertion ‘’ failed
Jul 26 10:16:41 nextcloudpi NetworkManager[647]: ((src/settings/nm-settings-connection.c:361)): assertion ‘’ failed
Jul 26 10:16:42 nextcloudpi sshd[25619]: Starting session: shell on pts/0 for root from 192.168.178.20 port 55948 id 0
Jul 26 10:17:01 nextcloudpi CRON[25763]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 26 10:17:01 nextcloudpi CRON[25764]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Jul 26 10:17:01 nextcloudpi CRON[25763]: pam_unix(cron:session): session closed for user root
Jul 26 10:19:15 nextcloudpi sudo[25803]: root : TTY=pts/0 ; PWD=/root ; USER=root ; COMMAND=/bin/systemctl start apache2.service
Jul 26 10:19:15 nextcloudpi sudo[25803]: pam_unix(sudo:session): session opened for user root by root(uid=0)
Jul 26 10:19:15 nextcloudpi systemd[1]: Starting The Apache HTTP Server…
– Subject: A start job for unit apache2.service has begun execution
– Defined-By: systemd
– Support: https://www.debian.org/support

– A start job for unit apache2.service has begun execution.

– The job identifier is 3380.
Jul 26 10:19:16 nextcloudpi apachectl[25806]: AH00526: Syntax error on line 5 of /etc/apache2/sites-enabled/ncp.conf:
Jul 26 10:19:16 nextcloudpi apachectl[25806]: SSLCertificateFile: file ‘/etc/letsencrypt/live/hmbxfo4t8rmmko4d.myfritz.net/fullchain.pem’ does not exist or is empty
Jul 26 10:19:16 nextcloudpi apachectl[25806]: Action ‘start’ failed.
Jul 26 10:19:16 nextcloudpi apachectl[25806]: The Apache error log may have more information.
Jul 26 10:19:16 nextcloudpi systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
– Subject: Unit process exited
– Defined-By: systemd
– Support: https://www.debian.org/support

– An ExecStart= process belonging to unit apache2.service has exited.

– The process’ exit code is ‘exited’ and its exit status is 1.
Jul 26 10:19:16 nextcloudpi systemd[1]: apache2.service: Failed with result ‘exit-code’.
– Subject: Unit failed
– Defined-By: systemd
– Support: https://www.debian.org/support

– The unit apache2.service has entered the ‘failed’ state with result ‘exit-code’.
Jul 26 10:19:16 nextcloudpi systemd[1]: Failed to start The Apache HTTP Server.
– Subject: A start job for unit apache2.service has failed
– Defined-By: systemd
– Support: https://www.debian.org/support

– A start job for unit apache2.service has finished with a failure.

Hi again,
I want to solve my own question :slight_smile:, so nobody else need to invest brain time :slight_smile:

Unbelievable: failed for 8 days trying. then, right after my first post, I had a new idea:
I found an old and expired backup from the former certificate for the old router. Restored it by renaming the old folders in /etc/letsencrypt/
./live_old to ./live
./archive_old to ./archive
./renewal_old to ./renewal

Then apache server starts again.
in the config.php file I replaced every address of the old router with the ones from the new router. Afterwards the letsencrypt certificate could be be renewed by standard script.

Hope my solution helps other people with a Fritz!box router change. :wink:
So long, and thank you for reading :slight_smile:

1 Like