httpd(8)

πŸ“¦ version 0.52, in ubuntu resolute, ubuntu stonking

πŸ’– httpd β€” handle an HTTP connection πŸ’–

okay bestie, gather round, because this is httpd(8) from the System Manager's Manual and it's literally the little server that could. no cap.


🌸 SYNOPSIS 🌸

httpd root

that's it. one argument. she's low maintenance like that. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so httpd prints requested public files from the root directory hierarchy. normally root is /public/file. yes, that's the normal one. iconic default behaviour, we love to see it. πŸ’…

httpd accepts GET and HEAD requests on standard input, in HTTP/0.9, HTTP/1.0, and HTTP/1.1 formats, and responds on standard output. here's the breakdown, bestie, and it's giving three completely different eras of the internet:

HTTP/0.9:

  • httpd prints the requested file and exits.

HTTP/1.0:

  • httpd prints an HTTP/1.0 header and the requested file. then it exits.

HTTP/1.1:

  • httpd prints an HTTP/1.1 header and the requested file in chunked format. then it waits for further requests. she's not done with you yet. 🫢

if the file is unopenable, or if httpd does not like the request, httpd prints an error message and exits. if httpd runs out of memory, encounters an I/O error, or does not receive an input packet within 60 seconds, it exits silently. 😭 silence. no goodbye. just gone.

httpd also prints local log information on standard error.

httpd has exact-prefix support for If-Modified-Since: it uses code 304 if the Last-Modified contents are an exact prefix of the If-Modified-Since contents. exact. prefix. don't try to be cute with it, she checks. πŸ‘‘

normally httpd is run under tcpserver to handle HTTP connections from hosts around the Internet. yes, the whole Internet. main character energy fr fr. 🌈


πŸŽ€ FILE HANDLING πŸŽ€

a request for http://v/f refers to the file named ./v/f inside the root directory hierarchy, if f does not end with a slash. a request for http://v/f/ refers to the file named ./v/f/index.html. the slash changes everything, bestie. it's the whole plot twist. πŸ’€

httpd always converts the host name v to lowercase. HTTP/0.9 requests and old HTTP/1.0 requests do not specify a host name; in this case httpd uses the host name 0. that's not a typo, that's just her. zero. okay.

if it successfully opens the file, httpd uses the file name to select a file type for HTTP/1.0 and HTTP/1.1.


πŸ”₯ SECURITY πŸ”₯

httpd chroots to root when it starts. she locks herself in the house and throws away the key. then she sets her group id and user id to the numbers given in environment variables $GID and $UID, as set by envuidgid. ✨

httpd does not allow dots immediately after slashes in file names. it changes these dots to colons before attempting to open the file. sneaky little dot. not on her watch. πŸ™ˆ

httpd will refuse to read a file if the file:

  • is unreadable to user;
  • is unreadable to group;
  • is unreadable to world;
  • is world-executable without being user-executable; or
  • is anything other than a regular file: a directory, socket, device, etc.
so yeah, if it's not a regular file, or if the permissions are giving sketchy, she is simply not opening it. periodt. πŸ’…

πŸ’€ UNSUPPORTED FEATURES πŸ’€

  • httpd does not support file modification requests such as POST.
  • httpd does not support SSI or CGI.
  • httpd rejects requests specifying Content-Length, Transfer-Encoding, Expect, If-Match, If-None-Match, or If-Unmodified-Since.
  • httpd does not generate its own directory listings, even if index.html does not exist. httpd rejects requests for directory names without terminating slashes; it does not redirect the requests.
no listings, no redirects, no negotiation. she said no and she meant no. 😀

πŸ‘‘ AUTHOR πŸ‘‘

the content of this manpage is taken verbatim from Daniel J Bernstein's work at ⟨https://cr.yp.to/publicfile/httpd.html⟩ and converted to roff by Joost van Baal-IliΔ‡. shoutout to the legends. 🫢


🌟 SEE ALSO 🌟

the original website ⟨https://cr.yp.to/publicfile/httpd.html⟩.


okay so that's the whole page, bestie. you made it to the end, which is honestly so slay of you. πŸ’–

and before you go β€” this absolute queen of a manual page is publicfile 0.52-12, dated 2021-10-10, and it's the httpd(8) page from the System Manager's Manual. love that for her. now go serve some files. βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…

πŸ“¦ where this page comes from