apache2.service: Failed with result 'exit-code' Nginx / Apache Origin: Edge & web server OSI layer 7 · Application Last updated 5 Nov 2026

systemd: apache2.service: Main process exited, code=exited, status=1/FAILURE — Job for apache2.service failed because the control process exited with error code

systemd couldn't start Apache — the real error is in the journal or apachectl configtest.

Exact message you may see apache2.service: Failed with result 'exit-code'Job for apache2.service failed because the control process exited with error codehttpd.service: Main process exited, code=exited, status=1/FAILUREFailed to start The Apache HTTP Serverapache2.service: Control process exited, code=exited status=1
Seen on: Apache Linux

Meaning

Run sudo apachectl configtest and sudo journalctl -xeu apache2 (or httpd on RHEL). Typical reasons: syntax error, port in use (AH00072), missing log directory (AH00015), missing module/cert file, or SELinux denial.

Common causes

  • Config syntax error
  • Port already in use
  • Missing SSL certificate/key files
  • Log directory problems
  • SELinux/AppArmor denial

⚡ Quick fix

  1. sudo apachectl configtest
  2. sudo journalctl -xeu apache2 --no-pager | tail -50
  3. Fix the reported AH code and restart

Detailed fix by platform

Linux

  1. sudo apachectl configtest; sudo journalctl -xeu apache2 --no-pager | tail -40

How to diagnose

  1. Test — configtest output?
  2. Journal — AH code?
  3. Port — Free?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Edge & web server. Errors that are often confused with or caused by this one (click to open):

AH00015: Unable to open logs — Apache: AH00091: apache2: could not open error log file /var/log/apache2/error.log. AH00015: Unable to open logs (Permission denied) (Nginx / Apache)AH00015: Unable to op…AH00037: Symbolic link not allowed or link target not accessible — Apache: [core:error] AH00037: Symbolic link not allowed or link target not accessible: /var/www/html/current (Nginx / Apache)AH00037: Symbolic lin…AH00072: make_sock: could not bind to address 0.0.0.0:80 — Apache: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80 / AH00015: Unable to open logs (Nginx / Apache)AH00072: make_sock: c…AH00112: DocumentRoot does not exist — Apache: AH00112: Warning: DocumentRoot [/var/www/example.com/public_html] does not exist (Nginx / Apache)AH00112: DocumentRoot…AH00526: Syntax error on line of apache config — Apache: AH00526: Syntax error on line 12 of /etc/apache2/sites-enabled/site.conf: Invalid command 'Foo', perhaps misspelled or defined by a module not included in the server configuration (Nginx / Apache)AH00526: Syntax error…AH00558 — Apache: AH00558: apache2: Could not reliably determine the server's fully qualified domain name (Nginx / Apache)AH00558Failed to connect to bus — Failed to connect to bus: No such file or directory (systemctl --user / timedatectl) (Linux)Failed to connect to …Job for x.service failed — Job for nginx.service failed because the control process exited with error code (Linux)Job for x.service fai…apache2.s…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.