TOOLTIKI Lovable tool, really free
Developer Config

Apache config formatter

Indent

Processed in your browser · nothing is uploaded

Local · formatting only — configtest is the authority
Advertisement
320 × 100

Reindents an Apache configuration by block depth, treating `<Directory>`, `<VirtualHost>` and the other container directives as the levels they are.

How to use the apache config formatter

1 Paste your input. The result appears immediately.
2 Adjust the indent if the default is not yours.
3 Copy the result, or save it as a file.

Apache containers look like HTML and are not. `<Directory /var/www>` opens a scope that `</Directory>` closes, and the nesting decides which requests a directive applies to. Indentation makes that visible; Apache itself does not care. The order in which containers are merged is the part that surprises people, and it is not the order they appear in the file. Apache applies `<Directory>` sections shortest-path-first, then `<DirectoryMatch>`, then `<Files>`, then `<Location>` — so a `<Location>` block near the top of the file overrides a `<Directory>` block at the bottom. Reading the file top to bottom and expecting the last word to win gives the wrong answer. As with nginx, this formats and does not validate. `apachectl configtest` is the authority, and it catches the things that actually break a restart: a module not loaded for a directive you used, a path that does not exist, a certificate mismatch.

Questions

No. The containers define the scope; the indentation is for you.

Apache — configuration sections
Advertisement
300 × 250
Was this tool any good?
INTERNAL SIGNAL ONLY · WE USE IT TO FIND TOOLS WORTH REBUILDING