Failed to start The Apache HTTP Server

Hi,
I update nextcloudpi to version 1.4.9

Since the update the Error Message Failed to start the apache http server, i tried some but i cant restart it without the error message. In the out it write Lets encrypt is not in the folder, but i cant make a new in the ncp-config because it write the error behind a firewall, but i dont know why the ports open and it worked befor the update with no problem, hope someone can help.

sudo systemctl status apache2.server
Unit apache2.server.service could not be found.
root@nextcloudpi:/# sudo systemctl status apache2.service
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset:
Active: failed (Result: exit-code) since Sun 2019-01-27 20:56:42 GMT; 1min 19
Process: 590 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILUR

Jan 27 20:56:19 nextcloudpi systemd[1]: Starting The Apache HTTP Server…
Jan 27 20:56:42 nextcloudpi apachectl[590]: AH00526: Syntax error on line 5 of /
Jan 27 20:56:42 nextcloudpi apachectl[590]: SSLCertificateFile: file '/etc/letse
Jan 27 20:56:42 nextcloudpi apachectl[590]: Action ‘start’ failed.
Jan 27 20:56:42 nextcloudpi apachectl[590]: The Apache error log may have more i
Jan 27 20:56:42 nextcloudpi systemd[1]: apache2.service: Control process exited,
Jan 27 20:56:42 nextcloudpi systemd[1]: Failed to start The Apache HTTP Server.
Jan 27 20:56:42 nextcloudpi systemd[1]: apache2.service: Unit entered failed sta
Jan 27 20:56:42 nextcloudpi systemd[1]: apache2.service: Failed with result 'exi
lines 1-14/14 (END)
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2019-01-27 20:56:42 GMT; 1min 19s ago
Process: 590 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

Jan 27 20:56:19 nextcloudpi systemd[1]: Starting The Apache HTTP Server…
Jan 27 20:56:42 nextcloudpi apachectl[590]: AH00526: Syntax error on line 5 of /etc/apache2/sites-enabled/ncp.conf:
Jan 27 20:56:42 nextcloudpi apachectl[590]: SSLCertificateFile: file '/etc/letsencrypt/live/..****/fullchai
Jan 27 20:56:42 nextcloudpi apachectl[590]: Action ‘start’ failed.
Jan 27 20:56:42 nextcloudpi apachectl[590]: The Apache error log may have more information.
Jan 27 20:56:42 nextcloudpi systemd[1]: apache2.service: Control process exited, code=exited status=1
Jan 27 20:56:42 nextcloudpi systemd[1]: Failed to start The Apache HTTP Server.
Jan 27 20:56:42 nextcloudpi systemd[1]: apache2.service: Unit entered failed state.
Jan 27 20:56:42 nextcloudpi systemd[1]: apache2.service: Failed with result ‘exit-code’.

you have to look at this line. or post it here.

This is the line for the certificate of Letsencrypt, i dont understand why, i only update to 1.4.9 in the webclient without error, after the update the nextcloud pi writes this error mhhh? And the file *.pem also the zertificats are exist in the folder but it makes the error

Listen 4*****
<VirtualHost default:>
DocumentRoot /var/www/ncp-web
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/*******.
./fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/
..**/privkey.pem

2 days to avoid very big backups requests to timeout

TimeOut 172800

DefineExternalAuth pwauth pipe /usr/sbin/pwauth

AuthType Basic
AuthName “ncp-web login”
AuthBasicProvider external
AuthExternal pwauth

SetEnvIf Request_URI “^” noauth
SetEnvIf Request_URI “^index.php$” !noauth
SetEnvIf Request_URI “^/$” !noauth
SetEnvIf Request_URI “^/wizard/index.php$” !noauth
SetEnvIf Request_URI “^/wizard/$” !noauth

Require host localhost Require local Require ip ***.***. Require ip *** Require ip ** Require env noauth Require user ncp

Exactly the same thing has just happened to me. Same errors pointing at same line in same config file.

Luckily I made a backup image of my microSD card 2 days ago, so rolling back to that works (running 1.4.6 from that backup). I know 1.4.8 also worked. But only went wrong this evening when updating to 1.4.9.

Hi,
I solved the problem, when i go the path /etc there are two folders, letsencrypt and letsencrypt-old,
in the letsencrypt folder und live/.:**(Doamein) the fullchain.pem are exist but empty. so i must delete with rm comant all the files and then i move to the etc/letsencrypt-old/live/..(Domain) and copy all file in the letsencrypt/live/***.*.(Domain)/ folder with the cp command, and nextcloudpi is booting up without error. And the Letsencrypt zertifikate update worked again to. Thats its.

Maybe at other people is the same, then look in the original live folder an open with nano the *.pem files if the empty, make the steps i wrote above

can be closed

thx for the fast help

1 Like

Great, will try this fix now and see if it works for me.

Just I case anyone else has this issue I found I had to be quite careful about how I removed the empty files to make sure certificates didn’t still end up empty. Basically I found that because of the empty *.pem files letsencrypt wouldn’t update to the version that comes with NCP 1.4.9 so I essentially had a partially successful update installed for NCP.

So to fix this issue I did…

sudo rm -r /etc/letsencrypt/live/…your domain name…

then run…

sudo ncp-config

In my case because of the only partially successful update to 1.4.9 ncp-config warned me I needed to upgrade letsencrypt. So I selected the version for 1.4.9.

Once in the config tool go to the network menu and the letsencrypt submenu. Force it to refresh certificates. Exit the config tool.

Now check that the *.pem files in /etc/letsencrypt/live/…your domain name… have something in them if you open them in nano or a similar editor.

If in the above you have a folder called “your domain name-0001” you’ll need to rename it using mv to remove the -0001 so your folder is just your domain name.

Reboot.

As a final double-check run…

sudo ncp-update

It should report you are all up-to-date.

Check you can access your next cloud server and your user accounts through the web client or through the desktop or mobile clients.

Edit: added missing step above, as commented by others below.

1 Like

Hi,
I did all the things you wrote, but ncp-config and letsencrypt I found new *.pem files in “my domain name-0001”.
I had tocopy them to “my damian name” and then it works.

Hi,
I just started with ncp. Fantastic work!!! Thanks a lot to all participants.

Unfortunately, I had the same error updating NCP to the latest version, the web-server is not starting again and with the same error:
apache2ctl configtest
AH00526: Syntax error on line 5 of /etc/apache2/sites-enabled/ncp.conf:
SSLCertificateFile: file ‘/etc/letsencrypt/live/XXX.XXX/fullchain.pem’ does not exist or is empty
Action ‘configtest’ failed.
The Apache error log may have more information.
I tried to use the fix from [DrD2k3] ( sudo rm -r /etc/letsencrypt/live/…your domain name…, etc.), but it did not work. (I did not get the same error, but no web server)
I have both letsencrypt folders, non empty. Majority of files in the new one.
placing -old into the line did not help.
What solved my Problem was to rename the new copy of the directory:
sudo mv /etc/letsencrypt/live/MYSERVER-0001 /etc/letsencrypt/live/MYSERVER

So it might also help, if other bits did not.

Yes actually forgot that from my instructions. Rename the 0001 folder back to just your domain name as you suggested.