Failed to use 'sudo systemctl status apache2'

1.1k views Asked by At

I'm currently trying to install and run apache2, I could install it but not configure it using 'sudo systemctl status apache2' and this error appears:

systemd[1]: Starting The Apache HTTP Server...
apachectl[16656]: (98)Address already in use: AH00072: make_sock: could not bind to ad>
apachectl[16656]: (98)Address already in use: AH00072: make_sock: could not bind to ad>
apachectl[16656]: no listening sockets available, shutting down
 apachectl[16656]: AH00015: Unable to open logs
apachectl[16646]: The Apache error log may have more information.
systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
systemd[1]: apache2.service: Failed with result 'exit-code'.
systemd[1]: Failed to start The Apache HTTP Server.
lines 1-15/15 (END)

So, when I googled about this error I found maybe my port 80 was alredy been used and tried 'ss --listening --tcp --numeric --processes' to find out what is using port 80/tcp, I also kind of messed up using this command sudo kill -9, and now but none of the outputs say 80.

Thank you so much for your valuable help.

1

There are 1 answers

0
Adityan.P On

Hi, This error is most probably caused by another process in the port you are trying to run apache on. Or it can also be the fact that your firewall (ufw) might be blocking apache.

To check if the firewall is blocking apache run: sudo ufw app list in your teminal. If apache is in the list then it might be another process. If apache is not in your app list run this command: sudo ufw allow apache2 and then restart apache using sudo systemctl start apache2.

Hope this was helpful