1

I tried sudo systemctl restart apache2 and I get this output: Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.

When I try "systemctl status apache2.service":

● 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 Mon 2019-02-11 03:02:35 UTC; 2min 3s ago Process: 12193 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

And when I try: "journalctl -xe":

Hint: You are currently not seeing messages from other users and the system.
      Users in groups 'adm', 'systemd-journal' can see all messages.
      Pass -q to turn off this notice.
-- Support: http://www.ubuntu.com/support
-- 
-- Unit UNIT has finished starting up.
-- 
-- The start-up result is RESULT.
Feb 11 02:39:01 ths systemd[4215]: Reached target Default.
-- Subject: Unit UNIT has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit UNIT has finished starting up.
-- 
-- The start-up result is RESULT.
Feb 11 02:39:01 ths systemd[4215]: Startup finished in 70ms.
-- Subject: User manager start-up is now complete
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The user manager instance for user 1001 has been started. All services queued
-- for starting have been started. Note that other services might still be starting
-- up or be started at any later time.
-- 
-- Startup of the manager took 70596 microseconds.
lines 1794-1816/1816 (END)

I've tried multiple solutions from googling and also tried to reinstall apache and I'm still getting this error. Any advice?

Edit: sudo systemctl status apache2 gives:

> ● 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 Mon 2019-02-11 03:37:30 UTC; 1min 36s ago   Process:
> 21753 ExecStart=/usr/sbin/apachectl start (code=exited,
> status=1/FAILURE)
> 
> Feb 11 03:37:30 ths systemd[1]: Starting The Apache HTTP Server... Feb
> 11 03:37:30 ths apachectl[21753]: (98)Address already in use: AH00072:
> make_sock: could not bind to address [::]:80 Feb 11 03:37:30 ths
> apachectl[21753]: (98)Address already in use: AH00072: make_sock:
> could not bind to address 0.0.0.0:80 Feb 11 03:37:30 ths
> apachectl[21753]: no listening sockets available, shutting down Feb 11
> 03:37:30 ths apachectl[21753]: AH00015: Unable to open logs Feb 11
> 03:37:30 ths apachectl[21753]: Action 'start' failed. Feb 11 03:37:30
> ths apachectl[21753]: The Apache error log may have more information.
> Feb 11 03:37:30 ths systemd[1]: apache2.service: Control process
> exited, code=exited status=1 Feb 11 03:37:30 ths systemd[1]:
> apache2.service: Failed with result 'exit-code'. Feb 11 03:37:30 ths
> systemd[1]: Failed to start The Apache HTTP Server.

Edit 2: $ apachectl configtest

Syntax OK

  • Try to TEST the Apache CONFIGURATION with apachectl configtest and please edit/paste the output – cmak.fr Feb 11 at 9:14
  • I tried it and the output was Syntax OK – xMeraki Feb 11 at 15:40
1

Within the output of sudo systemctl status apache2 we can see the following messages:

... could not bind to address [::]:80 ...

... could not bind to address 0.0.0.0:80 ...

I suppose the port 80 is used by an another service. Use one of the next commands to find which is this service:

sudo lsof -i -n -P | grep ':80'
sudo netstat -peanut | grep ':80'

Then stop (or disable) thath service and restaart (enable) Apache. If Apache is sucessfully enabled, then you can decide to disable the other service permanently or change the port 80 on one of the two conflict services (Apache ot the other one).

References:

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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