3

I'm trying to restart apache2 service and i'm having error.

reload:

Job for apache2.service invalid.

restart:

Job for apache2.service failed. See "systemctl status apache2.service" and "journalctl -xe" for details.

journalctl -xe:

Aug 18 02:17:49 xpto apache2[6754]: * Starting web server apache2
Aug 18 02:17:49 xpto apache2[6754]: *
Aug 18 02:17:49 xpto apache2[6754]: * The apache2 configtest failed.
Aug 18 02:17:49 xpto apache2[6754]: Output of config test was:
Aug 18 02:17:49 xpto apache2[6754]: apache2: Syntax error on line 219 of /etc/apache2/apache2.conf: Synt
Aug 18 02:17:49 xpto apache2[6754]: Action 'configtest' failed.
Aug 18 02:17:49 xpto apache2[6754]: The Apache error log may have more information.
Aug 18 02:17:49 xpto systemd[1]: apache2.service: control process exited, code=exited status=1
Aug 18 02:17:49 xpto systemd[1]: Failed to start LSB: Apache2 web server.
-- Subject: Unit apache2.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

systemctl status apache2.service:

Aug 18 02:20:29 xpto apache2[6797]: *
Aug 18 02:20:29 xpto apache2[6797]: * The apache2 configtest failed.
Aug 18 02:20:29 xpto apache2[6797]: Output of config test was:
Aug 18 02:20:29 xpto apache2[6797]: apache2: Syntax error on line 219 of /etc/apache2/apache2.con... '>'
Aug 18 02:20:29 xpto apache2[6797]: Action 'configtest' failed.
Aug 18 02:20:29 xpto apache2[6797]: The Apache error log may have more information.
Aug 18 02:20:29 xpto systemd[1]: apache2.service: control process exited, code=exited status=1
Aug 18 02:20:29 xpto systemd[1]: Failed to start LSB: Apache2 web server.
Aug 18 02:20:29 xpto systemd[1]: Unit apache2.service entered failed state.
Aug 18 02:20:29 xpto systemd[1]: apache2.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

So what i'm doing wrong ? What can i do ? Line 219 is:

IncludeOptional sites-enabled/*.conf

Best Regards

3
  • check your config (apache.conf) file of the apache2 folder. I'm using kali. The config is in /etc/apache2/apache.conf.
    – user457862
    Oct 5, 2015 at 14:04
  • 1
    Edit your question and add the output of ls -la /etc/apache2/sites-enabled
    – A.B.
    Oct 5, 2015 at 14:19
  • 1
    Possible duplicate of Apache not starting
    – rancho
    Aug 1, 2016 at 18:16

1 Answer 1

1

After you made any changes to the Apache configuration file, before you reload the service, make sure that configuration is correct, or else it will cause you an unnecessary downtime.

To verify the configuration syntax for Apache:apachectl -t.

Secondly, you can look into /var/log/httpd/error.log for any hint.

From your information above, this has to do with a syntax error in the config file. Go to line 219 and fix the line.

1
  • 1
    Is this answer for Ubuntu?
    – itsazzad
    Oct 28, 2015 at 7:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .