YAWS(1)
π YAWS(1) β like, the manual page for yaws, bestie π
okay so first things first: this is page YAWS(1) from the User Commands part of the manual, and the command is literally called yaws, which stands for "yet another webserver" (iconic name, no notes). grab a lil snack, we're going through every single flag together π
β¨ NAME β¨
yaws β yet another webserver π¦
πΈ SYNOPSIS πΈ
yaws [OPTIONS]
that's it. that's the whole vibe. options go in, server comes out π
π DESCRIPTION π
Yaws is a fast lightweight webserver. fr fr, that's the whole pitch and it delivers.
It can run as a daemon or in interactive mode, and in interactive mode you can literally talk to the webserver directly, like a little conversation, so cute π«Ά
Yaws is particularly good at generating dynamic content. See the user docs for more info on that topic, because that's a whole other adventure bestie.
π§ DAEMON/SERVER options π§
-i|--interactiveβ interactive mode, babes. This starts yaws in interactive mode with an erlang prompt. Also, allerror_loggermessages get written to the tty in this mode too. Use this when you're developing yaws code. π-w|--winteractiveβ Cygwin inteactive mode (werl). (yes the typo is theirs, we keep it, periodt)-D|--daemonβ daemon mode. This starts yaws as a daemon. bye bestie, we're backgrounding you π--heartβ this makes the yaws system automatically restart itself if it crashes. And heads up: this switch also requires the--daemonswitch to be present. no daemon, no heart, that's the rule.--heart-restart=C,Tβ this controls how many restarts in a given time period that heart tolerates before it flat-out refuses to restart Yaws. By default, heart allows up to 5 restarts within a 60 second period before refusing to restart Yaws again. This option lets you do up toCrestarts inTseconds instead. Wanna allow infinite restarts? Set bothCandTto0. And btw, this switch automatically enables the--heartswitch. it just does that.--debugβ debug mode. This produces some auxiliary error output for some error conditions. It also starts the otpsasllib for additional error printouts. extra chatter, we love her π--nodebugβ non-debug mode. Super useful for running interactively via the-ioption but without incurring the performance penalties of debug mode. all the vibes, none of the lag β¨--conffile β use a different configuration file than the default. If the configuration parameterconfigis set, yaws uses it as the default configuration file. Else, the default configuration file when running as root is/etc/yaws/yaws.conf. When running as a non-priviliged user, yaws searches for its configuration file in this order: first in$HOME/yaws.conf, then in./yaws.conf, and finally in/etc/yaws/yaws.conf. it's giving scavenger hunt π--runmodmodule β tells yaws to callmodule:start/0at startup. This makes it possible to start up user-specific applications together with yaws. bring your friends to the party π--papath β add path to the yaws system search path.--tracetrafβ traffic trace mode. All traffic gets written to a trace file calledtrace.trafficin the log directory. π--tracehttpβ HTTP trace mode. All HTTP messages get written to a trace file calledtrace.httpin the log directory.--traceoutβ when yaws is put into trace mode using either--tracetrafor--tracehttp, traces are written to files. If we provide the--traceoutflag, the trace will also be written to stdout. double the tea β--traceβ same as--tracetraf --traceout. I.e. trace everything and write to stdout. maximalist behaviour, respect.--mnesiadirdir β start Mnesia in directory<dir>.--snamexxx β start yaws as a distributed erlang node with name<xxx>using the unqualified hostname as nodename postfix.--disable-kpollβ by default, yaws starts erlang with+K true. This flag reverses that. flipping the switch, bestie.--namexxx β start yaws as a distributed erlang node with name<xxx>using the fully qualified hostname as nodename postfix. (yes this is the sibling of--sname, they're twins, one's just more formal π )--proto_distMod β use moduleModfor erlang distribution. This is typically only used when we want to run erlang distribution over SSL. fancy π--erlargSTRING β passSTRINGas an additional argument to theerlprogram. IfSTRINGcomprises multiple words, you must quote it so that your shell passes it to yaws as a single argument. IfSTRINGcontains any single quote characters, you must quote each of them as well. For example, to pass the option-env NAME O'Keeffetoerlfrom a Bourne-compatible shell:
--erlarg "-env NAME O\'Keeffe"
ok this one's fiddly, so read it twice bestie. quoting is not optional here, the shell will absolutely betray you otherwise π
--idID β this flag sets the id. If we're starting a daemon (or an interactive system), it gives the Yaws server the identityID. This means the server will write all internal files into the directory$HOME/.yaws/yaws/ID.
Yaws also creates a file called $HOME/.yaws/yaws/ID/CTL which contains the portnumber the daemon is listening on for control requests by the control command such as yaws --hup etc.
If we're invoking a control command which should perform some control function on the daemon, we may have to give the --id flag also to the control command. If we don't do this, the control command may interact with the wrong daemon due to finding the wrong ctl file. π
The daemon may also optionally specify the id in the yaws.conf configuration file.
--umaskMASK β set the umask for the daemon toMASK.--encoding latin|unicodeβ set the config file encoding (default:latin1).
π CONTROL OPTIONS π
The following list of options are used to control the daemon from the "outside" while it is running. like remote-controlling your bestie from across the room π«Ά
--hup [--id ID]β HUP the daemon. This forces the daemon to reread the configuration file. It also makes the daemon empty all its internal content caches. Hence when updating the doc root, HUPing the daemon is the fastest way to see the content updates. refresher moment β¨--stop [--id id]β stop the daemon (called id). go to sleep bb π΄--lsβ lists current ids and status of all yaws servers on localhost. In practice this amounts to alistdirin$HOME/.yaws/yawsβ and check whether the different systems who have created files there are alive. lil headcount π--status [--id id]β query a running yaws daemon for its status, and print it.--stats [--id id]β query a running yaws daemon for its statistics, and print it. numbers, we love numbers π--running-config [--id id]β query a running yaws daemon for its current configuration, and print it. This can be useful when attempting to figure out how to set config in embedded mode. Configure yaws to your liking in non-embedded mode, run this command, and use the output to populate the embedded mode records. chef's kiss shortcut π--loadModules[--id id]β try to (re)load erlang modules into a running daemon. This is useful after modifying appmods or modules used by scripts. hot reload, no restart, that's the dream π¦--debug-dump [--id id]β produce a debug dump on stdout. In particular this code lists what we refer to as suspicious processes. I.e. processes that might be hanging or processes that are "large" β hardcoded to 40k words. π sus.--ctltrace [--id ID] http | traffic | offβ control the trace capabilities of a running yaws daemon. If thehttportrafficoption is given, the daemon will write a log for debug purposes into the logdir.--wait-started[=T] [--id ID]β waits at most 30 seconds for the server to start. Exits with0if the server is running,1otherwise. Typically useful in test scripts. The default 30 seconds can be modified by appending=Tto the option, whereTis the desired number of seconds to wait for the server to start. we are β¨patientβ¨ but only for 30 seconds by default.
π MISC OPTIONS π
--checkYawsFile[IncDirs ....]β test compile a.yawsfile. Useful in Makefiles when we want to ensure that all.yawsfiles are syntactically correct. syntax check bestie, no surprises π--versionβ output version information and exit.
π¦ ENVIRONMENT VARIABLES π¦
HOMEβ is used to determine where we write the temporary files. By default all tmp files end up in$HOME/.yaws. This includes the JIT files that are the result of processed.yawsfiles and also the so called control file that is used by the daemon to write the port number to which it is listening for control commands such asyaws --status.
Thus HOME is the handle we use in the control commands to find the control file so that we know where to connect to. it's the group chat pin π
YAWSHOMEβ can be used to override theHOMEvariable. This is useful when we for example are running yaws under port binding programs such asauthpriv.
It's useful by distros that don't want Yaws to write any files ever in the HOME directory of root. respect the boundaries π«Ά
π AUTHOR π
Written by Claes Wikstrom. ty king π
β SEE ALSO β
go read those too, iykyk π
πΈ okay that's the whole page bestie, every flag, every default, every warning, nothing skipped, no cap πΈ
and a lil sign-off: this was page YAWS(1) from the User Commands manual β go forth and serve some dynamic content, you main character ππβ¨
π¦ where this page comes from
- debian bookworm: yaws 2.1.1+dfsg-2 Β· BSD-YAWS
- debian trixie: yaws 2.2.0+dfsg-2 Β· BSD-YAWS
- nixos 26.05: yaws 2.2.0
- nixpkgs unstable: yaws 2.3.1
- ubuntu jammy: yaws 2.1.1+dfsg-1 Β· BSD-YAWS
- ubuntu noble: yaws 2.1.1+dfsg-2 Β· BSD-YAWS
- ubuntu questing: yaws 2.2.0+dfsg-2
- ubuntu resolute: yaws 2.2.0+dfsg-2build1 Β· BSD-YAWS
- ubuntu stonking: yaws 2.3.1+dfsg-2 Β· BSD-YAWS
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms