I'm trying to setup a virtual host. When I try and run sudo apachectl restart I get an error message.

Original error message:

Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

Checking systemctl status httpd.service:

● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fri 2017-04-28 08:52:35 CDT; 14s ago
     Docs: man:httpd(8)
  Process: 23763 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 23762 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 23762 (code=exited, status=1/FAILURE)

journalcte -xe shows:

No journal files were found.

I'm not sure what I'm looking at here and don't know how to fix this.

  • 2
    The journalctl command requires root privileges, otherwise you just get that misleading error message about no files being found. It rarely has any useful error messages anyway. The best error message will be the one you got back from apachectl restart. Could you include that in the question? – Ladadadada Apr 28 '17 at 14:05
  • That makes sense. I've updated the question with the original error message as well. thanks – Aninemity Apr 28 '17 at 17:04
  • 1
    This seems like a configuration syntax error, which is possible since you were modifying the configuration while setting up a new VirtualHost. Using sudo apache2ctl configtest should guide you. "It parses the configuration files and either reports Syntax Ok or detailed information about the particular syntax error." – Esa Jokinen Apr 29 '17 at 11:16
  • That error message you added is still a systemd error message, not an Apache error message. Can you run apachectl configtest? – Ladadadada May 1 '17 at 7:39
  • sry for the delay - apachectl configtest showed a few syntax issues so I'm going through these now. fingers crossed that'll solve it. Thanks for the suggestion! – Aninemity May 1 '17 at 14:40

Your Answer

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

Browse other questions tagged or ask your own question.