↑ ↓ select, Enter open, Esc close

Check the Apache configuration for syntax errors

root@server
apache2ctl configtest

Reads all configuration files and reports Syntax OK or the faulty file along with the line number. Run it after every change to virtual hosts, .conf files or modules, before reloading Apache. The running web server is left untouched.

Note: A warning like Could not reliably determine the server's fully qualified domain name is not an error, it only means ServerName is missing from the global configuration.

Also searched as

  • apache config test command
  • apache syntax ok check
  • apache won't start after config change
  • find apache2 configuration error

Related one-liners

All in Apache

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.