My apache2 had the following error:
root@Aspire3:/etc/apache2# systemctl status apache2
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Thu 2020-10-08 20:42:23 -03; 4min 48s ago
Process: 24443 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
out 08 20:42:23 Aspire3 apachectl[24443]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this
out 08 20:42:23 Aspire3 apachectl[24443]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
out 08 20:42:23 Aspire3 apachectl[24443]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
out 08 20:42:23 Aspire3 apachectl[24443]: no listening sockets available, shutting down
out 08 20:42:23 Aspire3 apachectl[24443]: AH00015: Unable to open logs
out 08 20:42:23 Aspire3 apachectl[24443]: Action 'start' failed.
out 08 20:42:23 Aspire3 apachectl[24443]: The Apache error log may have more information.
out 08 20:42:23 Aspire3 systemd[1]: apache2.service: Control process exited, code=exited status=1
out 08 20:42:23 Aspire3 systemd[1]: apache2.service: Failed with result 'exit-code'.
out 08 20:42:23 Aspire3 systemd[1]: Failed to start The Apache HTTP Server.
Then I found this response and it worked! But whenever I restart my computer, Apache returns to this error and I have to run these commands again. Does anyone know how to solve? I use Ububtu 18.04
Could be an issue with your firewall.
Try
sudo ufw allow 'Apache Full'; sudo systemctl restart apache2
and see if that helps.If not, please provide a little more detail as to the commands you need to run in order to get the server working again. Worst case scenario, you can make a bash script with the commands and then make a cron job to run them at startup (not the best solution but it works).
I have this problem right now. I figured out what the problem is, I installed NextCloud and this is spawning 4 different httpd processes listening on port 80. How I figured this out is this, first run:
and it output this:
I tried killing all these processes, but it instantly spawned new ones:
so to find out what is spawning these processes, I ran this:
and the output:
So to fix the problem I uninstalled nextcloud.