0

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

1
  • 2
    The response you linked basically just says "find the process and kill it". If you want a persistent solution, you will either need to prevent the corresponding service from starting - either by disabling it or by masking it - or configure the two services to use non-conflicting ports. See for example Can I run nginx and apache at the same time? – steeldriver Oct 14 '20 at 14:04
0

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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.