APACHE2(8)

๐Ÿ“ฆ
version 2.4.69 ยท 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing

๐Ÿ’– APACHE2(8) โ€” the manual page, but make it a group chat ๐Ÿ’–

okay so bestie, you're looking at APACHE2(8), which is the manual page for apache2 โ€” that's the Apache Hypertext Transfer Protocol Server btw, in case the name wasn't giving. and it's a section 8 page, so it's the system admin flavour, not the "just a lil user command" flavour. we love a main character entry ๐Ÿซถ


โœจ NAME โœจ

apache2 โ€” Apache Hypertext Transfer Protocol Server. that's it. that's the whole name. iconic, honestly. ๐Ÿ’…


โœจ SYNOPSIS โœจ

so here's the whole vibe, verbatim, no notes:

apache2 [ -d serverroot ] [ -f config ] [ -C directive ] [ -c directive
] [ -D parameter ] [ -e level ] [ -E file ] [ -k
start|restart|graceful|stop|graceful-stop ] [ -R directory ] [ -h ] [ -l
] [ -L ] [ -S ] [ -t ] [ -v ] [ -V ] [ -X ] [ -M ]

yeah it's a lot of brackets. it's giving "choose your own adventure" but make it daemon. ๐Ÿฆ‹


โœจ SUMMARY โœจ

apache2 is the Apache HyperText Transfer Protocol (HTTP) server program, fr fr. it's literally designed to be run as a standalone daemon process. and when you run it like that? it creates a pool of child processes or threads to handle requests. like a little squad of worker bees ๐Ÿ that just handle your HTTP traffic. obsessed.

but โ€” and this is the part where i need you to actually listen โ€” in general, apache2 should NOT be invoked directly. nope. instead you should invoke it via /etc/init.d/apache2 or apache2ctl. why? because the default Debian configuration requires environment variables that are defined in /etc/apache2/envvars, and those are not available if you start apache2 directly. so it'll just be sitting there missing its little env vars like ๐Ÿ˜ญ.

lowkey the whole point is: don't raw-dog the binary. use the wrapper. apache2ctl can be used to pass arbitrary arguments to apache2, which is the slay move. โœจ

โœจ DOCUMENTATION โœจ

the full documentation lives in the apache2-doc package, or you can go read it at http://httpd.apache.org/docs/2.2/ โ€” yes bestie, an actual URL, go click it, it's fine, it's not a rickroll.

and if you want the Debian-specific tea โ˜• โ€” all the changes and configuration details that Debian does differently โ€” that's in:

/usr/share/doc/apache2/README.Debian.gz

go read it. it's good for you. ๐Ÿ’œ


โœจ OPTIONS โœจ

alright, this is the main event, the runway, the moment. one bullet per flag, no skips, no "eh you don't need that one". we keep ALL of them. periodt. ๐Ÿ‘‘

  • -d serverroot โ€” sets the initial value for the ServerRoot directive to serverroot. caveat: this can be overridden by the ServerRoot directive in the configuration file. so it's like a first suggestion, not a binding contract. ๐Ÿ™ˆ
  • -f config โ€” uses the directives in the file config on startup. if config does not begin with a /, then it's taken to be a path relative to the ServerRoot. the default is /etc/apache2/apache2.conf. that's the default, bestie, memorize it or don't, but it's there. โœจ
  • -k start|restart|graceful|stop|graceful-stop โ€” signals apache2 to start, restart, or stop. see Stopping Apache for more information. (yes, the page says "see Stopping Apache", and yes, that's what we're telling you, we're not adding anything extra, we're being good. ๐Ÿซถ)
  • -C directive โ€” process the configuration directive before reading config files. before!! โฐ
  • -c directive โ€” process the configuration directive after reading config files. see? order matters. -C is before, -c is after. don't mix them up, that's a classic oopsie. ๐Ÿ’€
  • -D parameter โ€” sets a configuration parameter which can be used with <IfDefine> sections in the configuration files to conditionally skip or process commands at server startup and restart. conditional behaviour, we love a "maybe". ๐Ÿฆ‹
  • -e level โ€” sets the LogLevel to level during server startup. this is useful for temporarily increasing the verbosity of the error messages to find problems during startup. basically: turn the volume UP when things are being weird. ๐Ÿ”ฅ
  • -E file โ€” send error messages during server startup to file. so instead of screaming into the void, it screams into a file. ๐Ÿ“„
  • -R directory โ€” when the server is compiled using the SHARED_CORE rule, this specifies the directory for the shared object files. note the "when compiled using SHARED_CORE" โ€” that's the condition, don't forget it. ๐Ÿงš
  • -h โ€” output a short summary of available command line options. the lil cheat sheet. the snack. ๐Ÿ“
  • -l โ€” output a list of modules compiled into the server. โš ๏ธ this will not list dynamically loaded modules included using the LoadModule directive. so don't come for it when your LoadModule-ed modules aren't there, that's not its job.
  • -L โ€” output a list of directives together with expected arguments and places where the directive is valid. it's giving "full documentation dump". ๐Ÿ“š
  • -M โ€” dump a list of loaded Static and Shared Modules. (capital M for Modules, bestie. ๐Ÿ’…)
  • -S โ€” show the settings as parsed from the config file. heads up though: currently it only shows the virtualhost settings. that's the current state of things, no cap. ๐Ÿ‘‘
  • -t โ€” run syntax tests for configuration files only. the program immediately exits after these syntax parsing tests with either a return code of 0 (Syntax OK) or a return code not equal to 0 (Syntax Error). and extra tea: if -D DUMP_VHOSTS is also set, details of the virtual host configuration will be printed. if -D DUMP_MODULES is set, all loaded modules will be printed. so -t can be a whole info dump if you ask nicely. โœจ
  • -v โ€” print the version of apache2, and then exit. quick lil peek. ๐Ÿ‘€
  • -V โ€” print the version and build parameters of apache2, and then exit. the deluxe version. ๐ŸŒˆ
  • -X โ€” run apache2 in debug mode. only one worker will be started and the server will not detach from the console. one worker, glued to your terminal, no escape. it's giving "held hostage by your own debug session" ๐Ÿ’€ but like, on purpose, for debugging.

โœจ SEE ALSO โœจ

go forth and read those too. i know, i know, more reading. but that's the vibe. ๐ŸŽ€


and that's the whole page, bestie!! no cap, we kept every single flag, every default, every file path, every return code, every caveat. ๐Ÿ’–

this has been the apache2 manual page from the Apache HTTP Server, dated 2008-04-05, sitting in section APACHE2(8). yeah, the date's old, the docs are timeless, we don't make the rules. ๐Ÿฆ‹

k byeeee, go restart your server gracefully or something ๐Ÿ’…โœจ