micro-httpd(8)
π micro-httpd β the NAME section, bestie β¨
okay so hi!! this is micro-httpd and it's literally a really small HTTP server π¦ that's it that's the whole name, no notes, periodt.
πΈ SYNOPSIS πΈ
micro-httpd DIRECTORY
that's the whole vibe. one argument. one directory. go off π
β¨ OPTIONS β¨
None. π
no flags. no long options. nothing to memorize. she simply does not have options, and honestly? iconic behaviour. not every server needs 47 toggles to feel valid π«Ά
π DESCRIPTION π
micro-httpd is a very small HTTP server β like, the entire thing is 150 lines of code. one hundred and fifty. that's shorter than some people's .bashrc. π
the catch: it runs from inetd, which means its performance is poor. no cap. but if your site is low-traffic, it's quite adequate β genuinely, it's fine, it's eating, it's serving.
and the way that it still implements all the basic features of an HTTP server?? obsessed:
- Security against
".."filename snooping. π‘οΈ (so nobody goes sneaking up the directory tree, we love a secure queen) - The common MIME types.
- Trailing-slash redirection.
index.html- Directory listings.
π how to install her (the inetd.conf era)
to install it, you add a line like this to /etc/inetd.conf:
micro-http stream tcp nowait nobody \
/usr/sbin/micro-httpd micro-httpd dir
make sure the path to the executable is correct (fr fr, double-check it), and change "dir" to be the directory you want to serve. like, the actual directory. the one with your stuff in it. π
you could also add a line like this to /etc/services:
micro-http port/tcp #Micro HTTP server
change "port" to the port number you want to use: 80, 8000, whatever. dealer's choice bestie β¨
then restart inetd by sending it a "HUP" signal. bye girl, go reload π«
π the spawn-rate drama (read this one)
on some systems, inetd has a maximum spawn rate. so if you try to run inetd services faster than a certain number of times per minute, it assumes there's either a bug or an attack going on and it shuts down for a few minutes. she's dramatic like that.
if you run into this problem β look for syslog messages about too-rapid looping β you'll need to find out how to increase the limit. unfortunately this varies from OS to OS. π₯²
- On FreeBSD, you add a
"-R 10000"flag to inetd's initial command line. - On some Linux systems, you can set the limit on a per-service basis in
inetd.conf, by changing"nowait"to"nowait.10000".
π HTTPS?? yes actually π
note that you can use micro-httpd to serve HTTPS, if you like, by running it from stunnel. yes, really. she contains multitudes.
first, fetch and install stunnel β FreeBSD users can just go to /usr/ports/security/stunnel and do a "make cert ; make install". π
then as root, run:
stunnel -p /usr/local/certs/stunnel.pem -d 443 -l \
/usr/sbin/micro-httpd -- micro-httpd dir
make sure the paths to the certificate and executable are correct, and again don not forget to change "dir" to the directory you want to serve. (the original says "don not" β a whole typo, and honestly? we respect the hustle π)
π¦ ENVIRONMENT π¦
None. nothing. empty. the void. no environment variables here, she doesn't need them πΈ
β FILES β
None. literally none. not a single file listed. clean girl aesthetic π
π SEE ALSO π
the whole friend group π«Ά go read about them too.
π AUTHORS π
Copyright (C) 1999 Jef Poskanzer <jef@mail.acme.com>. All rights reserved.
This manual page was updated by Jari Aalto <jari.aalto@cante.net>. Released under license GNU GPL v2 or (at your option) any later version. For more information about license, visit <http://www.gnu.org/copyleft/gpl.html>.
and that's the whole page, bestie!! π this was micro-httpd from the User Commands crew, dated 2021-10-14 β mwah, go serve something cute π
β¨π¦π
π¦ where this page comes from
- ubuntu jammy: micro-httpd 20140814-2.1 Β· BSD-2-Clause
- ubuntu noble: micro-httpd 20140814-2.1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms