Anúncios incomodam? Ir Sem anúncios Hoje

Apache httpd Config Formatter

DesenvolvedorRede
ANUNCIADO Remover?

Opções de Formatação

ANUNCIADO Remover?

Guia

Apache httpd Config Formatter

Apache httpd Config Formatter

Paste a messy Apache httpd.conf, apache2.conf, ou sites-available/*.conf snippet and get back a properly indented, normalized configuration. The formatter walks <VirtualHost>, <Directory>, <Location>, <IfModule>, and other container tags to compute correct nesting depth, preserves your comments and blank lines, and can canonicalize directive case so that servername, SERVERNAMEe, e ServerName all become consistent. The structure view summarizes each virtual host at a glance, and the validator flags mismatched or unclosed block tags before you reload Apache.

Como usar

  1. Paste your Apache configuration into the input box — a full httpd.conf, a single <VirtualHost> block, or any snippet.
  2. Pick an indent style (2 spaces, 4 spaces, or tab) and a directive case mode (preserve, PascalCase canonical, or lowercase).
  3. Alternar Normalize comments to ensure a space after #, Reduzir múltiplas linhas em brancoe, e Alinhar valores de diretiva if you want columns padded inside each block.
  4. Copy the formatted output, or download it as httpd.conf. Use the structure view to confirm your virtual-host layout and the validator to catch mismatched or unclosed block tags.

Características

  • Block-aware indentation – Tracks nesting through <VirtualHost>, <Directory>, <Location>, <Files>, <FilesMatch>, <IfModule>, <Limit>, <RequireAll>, and other container tags.
  • Directive case normalization – Optionally rewrite directives to canonical PascalCase (ServerName, DocumentRoot, RewriteEngine) or fold them to lowercase.
  • Continuation-line aware – Joins lines ending with \ so wrapped RewriteRule ou SSLCipherSuite directives stay on one logical line.
  • Comment & blank-line preservation – Keeps your # ... comments in place, optionally normalizes spacing after the hash, and collapses runs of blank lines.
  • Structure view – A nested outline of every block with key details (ServerName, DocumentRoot, Listen, ProxyPass) extracted for quick scanning.
  • Validação – Flags mismatched openers and closers (e.g. <Directory> closed with </Location>), unclosed blocks, stray closing tags, and duplicate ServerName values.
  • Snippet library – Drop-in templates for HTTP/HTTPS virtual hosts, HTTPS redirects, reverse proxies, PHP-FPM handlers, mod_rewrite force-HTTPS, mod_deflate compression, browser caching, security headers, and Basic Auth.
  • Directive reference – At-a-glance reference for the most common directives and container tags.
  • Privacidade – Runs entirely in your browser. Configurations are never uploaded.

Perguntas frequentes

  1. What is the difference between httpd.conf and a .htaccess file?

    httpd.conf (and the per-site files under sites-available/) is the main server configuration, parsed once when Apache starts. .htaccess files are per-directory overrides that Apache re-reads on every request when AllowOverride permits it. Both use the same directive syntax, but .htaccess can only contain directives whose context allows directory scope, and using it has a measurable performance cost compared to putting the same rules in a <Directory> block in the main config.

  2. Are Apache directive names case-sensitive?

    No. Directive names like ServerName, servername, and SERVERNAME are all valid and equivalent. Apache documentation uses PascalCase as the canonical form, which is what most style guides and config linters expect. Directive arguments, however, are often case-sensitive (filesystem paths on Linux, regular expressions, environment variable names, and so on).

  3. How does Apache decide which VirtualHost serves a request?

    Apache first matches by IP address and port from the <VirtualHost> tag (e.g. *:443). Among virtual hosts that match the same address and port, it then matches the request's Host header against ServerName and ServerAlias. If nothing matches, the first VirtualHost listed for that address:port becomes the default. This is why ServerName must be explicit and unique on a real production server.

  4. What is the order of evaluation between Directory, Location, and Files blocks?

    Apache merges sections in a defined order: <Directory> and .htaccess first, then <Files> and <FilesMatch>, then <Location> and <LocationMatch>. Within each group, non-regex sections are processed first, in shortest-to-longest path order, then regex variants in source order. <Location> runs last, which is why a Location block can override directives set in a Directory block above it.

  5. Why do block tags use ... instead of curly braces like Nginx?

    Apache's configuration grammar predates Nginx by about a decade and was modeled on SGML/HTML, where container scopes are written with paired open/close tags. Nginx chose a C-like brace style for compactness. Both grammars express the same idea — a directive that scopes a child set of directives — but Apache's tag pairs make mismatched closers easy to spot since the closing tag must name the block being closed.

Quer eliminar anúncios? Fique sem anúncios hoje mesmo

Instale nossas extensões

Adicione ferramentas de IO ao seu navegador favorito para acesso instantâneo e pesquisa mais rápida

Ao Extensão do Chrome Ao Extensão de Borda Ao Extensão Firefox Ao Extensão Opera

O placar chegou!

Placar é uma forma divertida de acompanhar seus jogos, todos os dados são armazenados em seu navegador. Mais recursos serão lançados em breve!

ANUNCIADO Remover?
ANUNCIADO Remover?
ANUNCIADO Remover?

Notícias com destaques técnicos

Envolver-se

Ajude-nos a continuar fornecendo ferramentas gratuitas valiosas

Compre-me um café
ANUNCIADO Remover?