Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 246 lines (211 sloc) 8.033 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
.TH YAWS "1" "" "" "User Commands" -*- nroff -*-
.SH NAME
yaws \- yet another webserver
.SH SYNOPSIS
.B yaws
[\fIOPTIONS\fR]
.SH DESCRIPTION
.\" Add any additional description here
.PP
Yaws is fast lightweight webserver. It can run as daemon or
in interactive mode where it is possible to directly interact
with the webserver. Yaws is particularly good at generating
dynamic content. See the user docs for more information on that topic.

.SH DAEMON/SERVER options


.TP
\fB\-i | --interactive\fR
Interactive mode. This will start yaws in interactive mode with an erlang
prompt. All error_logger messages will be written to the tty as well in this
mode. Use this when developing yaws code.
.TP
\fB\-w | --winteractive\fR
Cygwin inteactive mode (werl)
.TP
\fB\-D | --daemon\fR
Daemon mode. This will start yaws as a daemon.
.TP
\fB\--heart\fR
This will cause the yaws system to be automatically restarted
in case it should crash. This switch also requires the \fI--daemon\fR
switch to be present.
.TP
\fB\--heart-restart=C,T\fR
This controls the number of restarts in a given time period that heart
tolerates before refusing to restart Yaws. By default, heart allows up
to 5 restarts within a 60 second period before refusing to restart
Yaws again. This option allows up to \fIC\fR restarts in \fIT\fR
seconds instead. To allow infinite restarts, set both \fIC\fR and
\fIT\fR to 0. This switch automatically enables the \fI--heart\fR
switch.
.TP
\fB\--debug\fR
Debug mode. This will produce some auxiliary error output for some
error conditions. It will also start the otp sasl lib for additional
error printouts.
.TP
\fB\--nodebug\fR
Non-debug mode. This is useful for running interactively via the
\FI-i\fR option but without incurring the performance penalties of
debug mode.

.TP
\fB\--conf file\fR
Use a different configuration file than the default. If the configuration
parameter \fIconfig\fR is set, yaws use it as 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 will search for its configuration file in
the following order. First in $HOME/yaws.conf, then in ./yaws.conf and finally
in /etc/yaws/yaws.conf.
.TP
\fB\--runmod module\fR
Tells yaws to call \fImodule:start/0\fR at startup. This makes it possible
to startup user specific applications together with yaws.

.TP
\fB\--pa path\fR
Add path to the yaws system search path

.TP
\fB\--tracetraf\fR
Traffic trace mode. All traffic will be written to a trace file called trace.traffic
in the log directory.

.TP
\fB\--tracehttp\fR
HTTP trace mode. All HTTP messages will be written to a trace file called trace.http
in the log directory.

.TP
\fB\--traceout\fR
When yaws is put into trace mode using either --tracetraf or --tracehttp, traces are written to files. If we provide the --traceout flag, the trace will also be written to stdout.

.TP
\fB\--trace\fR
Sames as --tracetraf --traceout. I.e. trace everything and write to stdout.

.TP
\fB\--mnesiadir dir\fR
Start Mnesia in directory <dir>

.TP
\fB\--sname xxx\fR
Start yaws as a distributed erlang node with name <xxx>
using the unqualified hostname as nodename postfix

.TP
\fB\--disable-kpoll\fR
By default, yaws starts erlang with \fI+K true\fR. This flag
reverses that.

.TP
\fB\--name xxx\fR
Start yaws as a distributed erlang node with name <xxx> using the
fully qualified hostname as nodename postfix

.TP
\fB\--proto_dist Mod\fR
Use module Mod for erlang distribution. This is typically only used
when we want to run erlang distribution over SSL.

.TP
\fB\--erlarg STRING\fR
Pass STRING as an additional argument to the "erl" program. If STRING
comprises multiple words, you must quote it so that your shell passes
it to yaws as a single argument. If STRING contains any single quote
characters, you must quote each of them as well. For example, to pass
the option \fI-env NAME O'Keeffe\fR to "erl" from a Bourne-compatible
shell:
.PP
.nf
.ce
--erlarg "-env NAME O\\'Keeffe"
.fi

.TP
\fB\--id ID\fR
This flag sets the id. If we're starting a daemon (or an interactive
system) it gives the Yaws server the identity ID. This means that the
server will write all internal files into the directory
$HOME/.yaws/yaws/ID.

Yaws also creates a file called
${VARDIR}/run/yaws/ctl-${ID} which contains the portnumber the daemon
is listening on for control request 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.

.TP
\fB\--umask MASK\fR
Set the umask for the daemon to MASK.

.SH CONTROL OPTIONS
.PP
The following list of options are are used to control the daemon
from the "outside" while it is running.

.TP
\fB\--hup [--id ID]\fR
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.
.TP
\fB\--stop [--id id]\fR
Stop the daemon (called id)
.TP
\fB\--ls \fR
Lists current ids and status of all yaws servers on localhost. In practice this
amounts to a listdir in $HOME/.yaws/yaws - and check whether the different
systems who has created files there are alive.
.TP
\fB--status [--id id]\fR
Query a running yaws daemon for its status, and print it.
.TP
\fB--stats [--id id]\fR
Query a running yaws daemon for its statistics, and print it.
.TP
\fB--running-config [--id id]\fR
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 you liking in non-embedded mode, run
this command and use the output to populate the embedded mode records.
.TP
\fB--load Modules [--id id]\fR
Try to (re)load erlang modules into a running daemon. This is useful
after modifying appmods or modules used by scripts.

.TP
\fB--debug-dump [--id id]\fR
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.

.TP
\fB--ctltrace [--id ID] http | traffic | off\fR
Control the trace capabilities of a running yaws daemon. If the
http or traffic option is given, the daemon will write a log
for debug purposes into the logdir.

.TP
\fB--wait-started[=T] [--id ID] \fR
Waits at most 30 seconds for the server to start. Exits with 0 if
server is running, 1 otherwise. Typically useful in test scripts. The
default 30 seconds can be modified by appending \fI=T\fR to the option,
where \fIT\fR is the desired number of seconds to wait for the server
to start.

.SH MISC OPTIONS

.TP
\fB--check YawsFile [IncDirs ....]\fR
Test compile a `.yaws' file. Useful in Makefiles when we want to ensure
that all .yaws files are syntactically correct
.TP
\fB\--version\fR
output version information and exit

.SH ENVIRONMENT VARIABLES
.TP
\fBHOME\fR
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 .yaws files 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 as "yaws --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.

.TP
\fBYAWSHOME\fR
Can be used to override the HOME variable. This is useful when we
for example are running yaws under port binding programs such as
authpriv.

It's useful by distros that don't want Yaws to write any files
ever in the HOME directory of root.



.SH AUTHOR
Written by Claes Wikstrom
.SH "SEE ALSO"
.BR yaws.conf (5)
.BR erl (1)
Something went wrong with that request. Please try again.