Ubuntu – Failed to start The Apache HTTP Server

Apache2server

● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor pres
   Active: **failed** (Result: exit-code) since Sun 2018-07-08 22:32:36 SAST; 18
  Process: 18097 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/

Jul 08 22:32:36 anonymous apachectl[18097]: AH00558: apache2: Could not reli
Jul 08 22:32:36 anonymous apachectl[18097]: (98)Address already in use: AH00
Jul 08 22:32:36 anonymous apachectl[18097]: (98)Address already in use: AH00
Jul 08 22:32:36 anonymous apachectl[18097]: no listening sockets available, 
Jul 08 22:32:36 anonymous apachectl[18097]: AH00015: Unable to open logs
Jul 08 22:32:36 anonymous apachectl[18097]: Action 'start' failed.
Jul 08 22:32:36 anonymous apachectl[18097]: The Apache error log may have mo
Jul 08 22:32:36 anonymous systemd[1]: apache2.service: Control process exite
Jul 08 22:32:36 anonymous systemd[1]: apache2.service: Failed with result 'e
Jul 08 22:32:36 anonymous systemd[1]: **Failed to start The Apache HTTP Server**
lines 1-15/15 (END)

Best Answer

The reason Apache fails to start is because something is already listening on the port/ip combination. The log entries of "Address already in use" indicate this.

You need to identify what other service is running on those ports and then go and shut it off before turning on Apache.

However, since your log snippets ONLY are partial (and not from sudo systemctl -l status apache2 so we can see all the actual useful information in large form, or from /var/log/apache2/error.log directly), we can't really point you at which application(s) to look at since we can't determine the ports in use (my assumption is Port 80, in which case sudo ss -ntlp 'sport = 80' will get us a better idea of what is already listening on Port 80. Please replace '80' with whatever other port is actually in use according to the long log data, which is cut off in what you pasted here.)

Related Question