webfsd(1)
π webfsd β a lightweight http server π
okay bestie, so this is webfsd(1) from the General Commands Manual, and honestly? she's a whole vibe. let's get into it π¦
β¨ NAME β¨
webfsd β a lightweight http server πΈ
β¨ SYNOPSIS β¨
webfsd [ options ]
β¨ DESCRIPTION β¨
okay so picture this: it's a simple http server for purely static content. that's it. that's the whole girl. π
you can use it to serve the content of a ftp server via http, for example. she's also literally the bestie move for exporting some files the quick way β like, you start a http server in a few seconds, no editing some config file first, no drama, no nothing. β¨ just vibes and files. π
β¨ OPTIONS β¨
-hβ print a short help text and the default values for all options. and here's the cute part: if you use it as the last option, the printout will reflect your command line choices π-4β use IPv4 only.-6β use IPv6 only.-dβ enable debug output π-sβ write a start/stop notice and serious errors to the syslog. specify this option twice to get a verbose log (additional log events like dropped connections). π-tsec β set network timeout to sec seconds.-cn β set the number of allowed parallel connections to n. heads up: this is a per-thread limit.-an β configure the size of the directory cache. webfs has a cache for directory listings, bestie. the directory will be reread if the cached copy is more than one hour old or if the mtime of the directory has changed. the mtime will be updated if a file is created or deleted. it will not be updated if a file is only modified, so you might get outdated time stamps and file sizes π (iykyk)-jβ do not generate a directory listing if the index-file isn't found. π-yn β set the number of threads to spawn (if compiled with thread support).-pport β listen on port port for incoming connections.-rdir β set document root to dir.-Rdir β set document root to dir andchrootto dir before start serving files. β οΈ note that this affects the path for the access log file and pidfile too.-ffile β use file as index file for directories. if a client asks for a directory, it will get file as response if such a file exists in the directory, and a directory listing otherwise.index.htmlis a frequently used filename. π-nhostname β set the hostname which the server should use (required for redirects).-iip β bind to IP-address ip.-llog β log all requests to the logfile log (common log format). using"-"as filename makes webfsd print the access log to stdout, which is only useful together with the-Fswitch (see below).-Llog β same as above, but additional flush every line. useful if you want monitor the logfile withtail -f. π-mfile β read mime types from file. default is/etc/mime.types. the mime types are read beforechroot()is called (when started with-R).-kfile β use file as pidfile.-uuser β set uid to user (after binding to the tcp port). this option is allowed for root only.-ggroup β set gid to group (after binding to the tcp port). this option is allowed for root only.-Fβ don't run as daemon. webfsd will not fork into background, not detach from terminal, and report errors to stderr. main character energy, honestly π«Ά-buser:pass β set user+password for the exported files. only a single username/password combination for all files is supported. π-esec β expire documents after sec seconds. you can use that to make sure the clients receive fresh data if the content within your document root is updated in regular intervals. webfsd will send anExpires:header set to last-modified time plus sec seconds, so you can simply use the update interval for sec. π-vβ enable virtual hosts. this has the effect that webfsd expects directories with the hostnames (lowercase) under document root. if started this way:"webfsd -v -r /home/web", it will look for the file/home/web/ftp.foobar.org/path/filewhen asked forhttp://ftp.FOObar.org:8000/path/file. β¨-xpath β use path as CGI directory. path is interpreted relative to the document root. note that CGI support is limited to GET requests. the first character in the path string must be a slash!-~servdir β enable access to user specific subdirectories, uniformly located below subdir. a request for"/~user/path/file", is rewritten"$HOME/servdir/path/file", and is then checked for existence. here the user's home directory is retrieved from the system in the standard manner from$HOMEin the environment. mark well, that user specific requests are disabled completely, should this switch be missing. since user directories are most probably located outside of the server's root directory, care is needed with this option. β οΈ-Sβ secure web server mode. Warning: this mode is strictly for https. π-Cpath β file to use as SSL certificate. this file must be in chained PEM format, and may contain server certificate as well as RSA key, but the latter can equally well be a separate entity, see-K.-Kpath β file that contains the private key, if the key is not bundled with the certificate. π-Apath β optional file containing CA-certificate and certificate chain.-Vβ apply a verification procedure to the client certificate and chain. these must, if this option is chosen, be supplied by any client. each chain member must pass verification, and must in turn verify the next chain member. the validity time for the client certificate is checked. β-Qciphers β specify acceptable cipher priorities for handshake, data exchange, etc. the default value isNORMAL.
okay and here's some extra tea β:
webfsd can be installed suid root (although the default install isn't suid root). this allows users to start webfsd chroot()ed and to bind to ports below 1024. webfsd will drop root privileges before it starts serving files. π
access control simply relies on Unix file permissions. webfsd will serve any regular file and provide listings for any directory it is able to open(2). no cap. π¦
β¨ AUTHOR β¨
Gerd Knorr <kraxel@bytesex.org> FreeBSD port by Charles F. Randall <cfr@pobox.com>
β¨ COPYRIGHT β¨
Copyright (C) 1999,2000 Gerd Knorr <kraxel@bytesex.org>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
and that's the whole page bestie, we ate π
β¨ this was (c) 1999 Gerd Knorr, from the webfsd(1) page in the General Commands Manual β go forth and serve them static files, you absolute icon ππ
π¦ where this page comes from
- debian bookworm: webfs 1.21+ds1-12+b1 Β· GPL-2.0-or-later
- debian trixie: webfs 1.21+ds1-16 Β· GPL-2.0-or-later
- ubuntu jammy: webfs 1.21+ds1-12 Β· GPL-2.0-or-later
- ubuntu noble: webfs 1.21+ds1-12build3 Β· GPL-2.0-or-later
- ubuntu questing: webfs 1.21+ds1-16
- ubuntu resolute: webfs 1.21+ds1-17 Β· GPL-2.0-or-later
- ubuntu stonking: webfs 1.21+ds1-18 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms