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

A.B.
  • 90,397

1 Answers1

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.

kos
  • 35,891