How do I check for syntax errors in my Apache web server configuration

18,118

Solution 1

If syntax is ok:

sudo apache2ctl configtest

Will reply with:

Syntax OK

Solution 2

You can use this as well if you don't have httpd.

apachectl configtest

Solution 3

On linux, you use

/usr/sbin/httpd -t

On windows, you would use the equivalent command to the httpd.exe file

Share:
18,118
Cosmin Atanasiu
Author by

Cosmin Atanasiu

Software Engineer

Updated on July 28, 2022

Comments

  • Cosmin Atanasiu
    Cosmin Atanasiu almost 2 years

    How do I check for syntax errors in the configuration of my apache server without having to restart or reload the rules? This would be preferably done from the terminal/command line.