Unable to restart apache2 service while setting up nextcloud on raspberry pi

I wanted to set up my own cloud which is accesible even outside my home network so I was following the nextcloud on raspberry pi setup by wiredzero however the problem is after generating the certificate, it’s not allowing me to restart the apache2 service.

I am getting:
Job for apache2.service failed because the control process exited with error code.

Please help.

What is the error message?

sudo systemctl status apache2

I’m getting this:

apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2022-04-27 12:42:29 +08; 1h 22min ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 122981 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
CPU: 73ms

Apr 27 12:42:29 raspberrypi apachectl[122984]: AH00558: apache2: Could not reliably determine the server’s fully qualified do>
Apr 27 12:42:29 raspberrypi apachectl[122984]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]>
Apr 27 12:42:29 raspberrypi apachectl[122984]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.>
Apr 27 12:42:29 raspberrypi apachectl[122984]: no listening sockets available, shutting down
Apr 27 12:42:29 raspberrypi apachectl[122984]: AH00015: Unable to open logs
Apr 27 12:42:29 raspberrypi apachectl[122981]: Action ‘start’ failed.
Apr 27 12:42:29 raspberrypi apachectl[122981]: The Apache error log may have more information.
Apr 27 12:42:29 raspberrypi systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Apr 27 12:42:29 raspberrypi systemd[1]: apache2.service: Failed with result ‘exit-code’.
Apr 27 12:42:29 raspberrypi systemd[1]: Failed to start The Apache HTTP Server.

There is most likely another service already listening on the same ports as apache is trying to listen on. Most likely ports 80 and / or 443…

This should help you find the issue:

https://www.digitalocean.com/community/tutorials/apache-network-error-ah00072-make_sock-could-not-bind-to-address

Sir, you are awesome! I am totally blind in terms of doing these things but yet, your solutions are straightforward, easy to understand and best of all, I learnt a lot! Thanks!

1 Like

Glad you were able to solve your issue. :slight_smile: