A2QUERY.IN(1)

πŸ’– A2QUERY.IN(1) β€” the a2query girlie's guide πŸ’–

okay bestie, so this is a2query, a little section-1 manual page, and honestly? she's serving runtime config realness and I'm obsessed. ✨


🌸 NAME 🌸

a2query β€” go grab the runtime configuration from a local Apache 2 HTTP server. that's it, that's the job. 🫢


✨ SYNOPSIS ✨

a2query [-m [MODULE]] [-s [SITE]] [-c [CONF]] [-a] [-v] [-M] [-d] [-h]

like... look at her. all those lil flags. iconic πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so a2query is a program whose whole entire personality is retrieving configuration values from a locally available Apache 2 HTTP web server. and the way it was designed?? it was designed to be as robust as possible, which means it'll hand you back feasible values even if the Apache 2 syntax validator totally flops and fails. 😭 resilience queen fr fr.

and listen β€” this program is primarily meant to be used from maintainer scripts. so she's not here for the vibes, she's here for the automation. periodt.


πŸ’œ OPTIONS πŸ’œ

  • -a β€” returns the Apache 2 "Module Magic Version" (API version) number that the server was compiled with. and no cap: the version it gives you does not contain any minor versions that are known to be compatible with the major version returned. so don't go looking for them, they're not there. πŸ™ˆ
  • -c [CONF] β€” checks whether the configuration CONF is enabled. if you gave no argument at all? it just returns all the enabled configuration files, all of them, the whole lineup. ✨ and CONF gets compared by string comparison, ignoring a leading "mod_" prefix and possibly a .conf or .load suffix. so like, she's flexible about your naming, she's not gonna be weird about it. πŸŽ€
  • -h β€” displays a brief summary of how the program can be called, then exits. the lil "hey here's how you talk to me" moment. πŸ‘‘
  • -m [MODULE] β€” checks whether the module MODULE is enabled. and the argument? it's interpreted the same way as for configuration files queried by the -c switch. consistency, we love to see it. 🫢
  • -M β€” returns the currently enabled Apache 2 MPM (Multi Processing Module). capital M, capital energy. πŸ”₯
  • -s [SITE] β€” checks whether the module SITE is enabled. (yes bestie, the original says "module" here, I'm just the messenger πŸ’€) the argument is interpreted in the same way as for configuration files queried by the -c switch. same rules, same girl. 🌸
  • -v β€” returns the currently installed Apache 2 HTTP server version. lowercase v, lowercase vibes, still valid. ⭐
  • -q β€” suppresses any output. this is useful to invoke a2query from another script. this is useful if only the return code is of interest. two whole sentences of usefulness, we're eating well. πŸ“

🌈 EXIT CODES 🌈

okay this part actually matters, so pay attention bestie. πŸ‘€

a2query returns with a zero (0) exit status if the requested operation was effectuated successfully, and with a non-zero status otherwise.

and in case of an error, she leaves with:

  • error code 32 if a requested module, site or configuration was not found
  • error code 33 if a module, site or configuration was disabled by a maintainer script
  • and however, exit status 1 is returned if the module was not found at all
⚠️ yeah, 1 and 32 are both "couldn't find it" flavours, and that's not a typo, that's just how she is. check the codes, don't assume. πŸ’…

🧚 SEE ALSO 🧚

apache2ctl(8), apache2(8), perl(1) β€” go read your other favs too, they're all linked up. πŸ¦‹


πŸ‘‘ AUTHOR πŸ‘‘

this manual and a2query was written by Arno Toell <debian@toell.net>. shoutout to the author, fr fr, thank you for your service. 🫢


aaaand that's the whole page bestie!! πŸ’– this was the perl v5.40.1 version, dated 2026-10-01 β€” so go forth, query your Apache, and remember: runtime configuration is a love language. mwah. πŸ˜­βœ¨πŸ’…

πŸ“¦ where this page comes from