How do I check for errors in Apache configuration before restarting?

Asked

Viewed 2,182 times

2

Several times I needed to restart Apache after making some settings, I had the dislike of receiving a failure message, because there was an error in the configuration.

A colleague here at the site once informed me that there was a command in Apache that it was possible to check the configuration. So, before restarting the server, I might know if I made some syntax error - but for once, I forgot what the command is.

What is the command used to do this?

  • Ta talking about checking if httpd is having problems before starting the server?

  • @diegofm no, no, I’m talking about a command that checks the syntax of the Apache settings so that when you restart, it doesn’t fail. There is this command, Bacco told me. But I do not remember what it is :\

1 answer

6

apachectl configtest

or

httpd -t
  • Man, thank you. That was it. In my case I used apache2ctl configtest.

  • Cool. Don’t forget to mark the answer as correct! ;)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.