AH00526: Syntax error on line of apache config Nginx / Apache Origin: Edge & web server OSI layer 7 · Application Last updated 5 Nov 2026

Apache: AH00526: Syntax error on line 12 of /etc/apache2/sites-enabled/site.conf: Invalid command 'Foo', perhaps misspelled or defined by a module not included in the server configuration

Apache's config has a syntax problem or a directive from a module that isn't loaded.

Exact message you may see AH00526: Syntax error on line 12 of /etc/apache2/sites-enabled/site.confInvalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configurationSyntax error on line of apache2.confInvalid command 'Header', perhaps misspelledAction 'configtest' failed. The Apache error log may have more information
Seen on: Apache Linux

Meaning

Run apachectl configtest for the exact file/line. "Invalid command" usually means the module isn't enabled (a2enmod rewrite headers ssl proxy_http) or a typo. Missing </VirtualHost> or mismatched tags cause similar errors.

Common causes

  • Module not enabled (rewrite, headers, ssl, proxy)
  • Typo in directive
  • Unclosed container tag
  • Wrong syntax for the Apache version (2.2 vs 2.4)
  • Included file broken

⚡ Quick fix

  1. sudo apachectl configtest
  2. Enable the module: sudo a2enmod rewrite && sudo systemctl restart apache2
  3. Fix the typo or closing tag

Detailed fix by platform

Linux

  1. sudo apachectl configtest && sudo systemctl reload apache2

How to diagnose

  1. Line — File and number?
  2. Module — Loaded?
  3. Tags — Balanced?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Edge & web server. Errors that are often confused with or caused by this one (click to open):

.htaccess: Invalid command (500 Internal Server Error) — Apache: [core:alert] /var/www/html/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration (Nginx / Apache).htaccess: Invalid co…AH00015: Unable to open logs — Apache: AH00091: apache2: could not open error log file /var/log/apache2/error.log. AH00015: Unable to open logs (Permission denied) (Nginx / Apache)AH00015: Unable to op…AH00037: Symbolic link not allowed or link target not accessible — Apache: [core:error] AH00037: Symbolic link not allowed or link target not accessible: /var/www/html/current (Nginx / Apache)AH00037: Symbolic lin…AH00072: make_sock: could not bind to address 0.0.0.0:80 — Apache: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80 / AH00015: Unable to open logs (Nginx / Apache)AH00072: make_sock: c…AH00112: DocumentRoot does not exist — Apache: AH00112: Warning: DocumentRoot [/var/www/example.com/public_html] does not exist (Nginx / Apache)AH00112: DocumentRoot…AH00124: Request exceeded the limit of 10 internal redirects — Apache: AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary (Nginx / Apache)AH00124: Request exce…AH00128: File does not exist — Apache: [core:info] AH00128: File does not exist: /var/www/html/favicon.ico (404) (Nginx / Apache)AH00128: File does no…AH00161: server reached MaxRequestWorkers setting — Apache: [mpm_event:error] AH00484: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting (Nginx / Apache)AH00161: server reach…AH00526: …

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.