1YAWS(1) User Commands YAWS(1)
2
3
4
6 yaws - yet another webserver
7
9 yaws [OPTIONS]
10
12 Yaws is fast lightweight webserver. It can run as daemon or in interac‐
13 tive mode where it is possible to directly interact with the webserver.
14 Yaws is particularly good at generating dynamic content. See the user
15 docs for more information on that topic.
16
17
19 -i | --interactive
20 Interactive mode. This will start yaws in interactive mode with
21 an erlang prompt. All error_logger messages will be written to
22 the tty as well in this mode. Use this when developing yaws
23 code.
24
25 -w | --winteractive
26 Cygwin inteactive mode (werl)
27
28 -D | --daemon
29 Daemon mode. This will start yaws as a daemon.
30
31 --heart
32 This will cause the yaws system to be automatically restarted in
33 case it should crash. This switch also requires the --daemon
34 switch to be present.
35
36 --heart-restart=C,T
37 This controls the number of restarts in a given time period that
38 heart tolerates before refusing to restart Yaws. By default,
39 heart allows up to 5 restarts within a 60 second period before
40 refusing to restart Yaws again. This option allows up to C
41 restarts in T seconds instead. To allow infinite restarts, set
42 both C and T to 0. This switch automatically enables the --heart
43 switch.
44
45 --debug
46 Debug mode. This will produce some auxiliary error output for
47 some error conditions. It will also start the otp sasl lib for
48 additional error printouts.
49
50 --nodebug
51 Non-debug mode. This is useful for running interactively via the
52 -i option but without incurring the performance penalties of
53 debug mode.
54
55
56 --conf file
57 Use a different configuration file than the default. If the con‐
58 figuration parameter config is set, yaws use it as default con‐
59 figuration file. Else, The default configuration file when run‐
60 ning as root is /etc/yaws/yaws.conf. When running as a non priv‐
61 iliged user, yaws will search for its configuration file in the
62 following order. First in $HOME/yaws.conf, then in ./yaws.conf
63 and finally in /etc/yaws/yaws.conf.
64
65 --runmod module
66 Tells yaws to call module:start/0 at startup. This makes it pos‐
67 sible to startup user specific applications together with yaws.
68
69
70 --pa path
71 Add path to the yaws system search path
72
73
74 --tracetraf
75 Traffic trace mode. All traffic will be written to a trace file
76 called trace.traffic in the log directory.
77
78
79 --tracehttp
80 HTTP trace mode. All HTTP messages will be written to a trace
81 file called trace.http in the log directory.
82
83
84 --traceout
85 When yaws is put into trace mode using either --tracetraf or
86 --tracehttp, traces are written to files. If we provide the
87 --traceout flag, the trace will also be written to stdout.
88
89
90 --trace
91 Sames as --tracetraf --traceout. I.e. trace everything and write
92 to stdout.
93
94
95 --mnesiadir dir
96 Start Mnesia in directory <dir>
97
98
99 --sname xxx
100 Start yaws as a distributed erlang node with name <xxx> using
101 the unqualified hostname as nodename postfix
102
103
104 --disable-kpoll
105 By default, yaws starts erlang with +K true. This flag reverses
106 that.
107
108
109 --name xxx
110 Start yaws as a distributed erlang node with name <xxx> using
111 the fully qualified hostname as nodename postfix
112
113
114 --proto_dist Mod
115 Use module Mod for erlang distribution. This is typically only
116 used when we want to run erlang distribution over SSL.
117
118
119 --erlarg STRING
120 Pass STRING as an additional argument to the "erl" program. If
121 STRING comprises multiple words, you must quote it so that your
122 shell passes it to yaws as a single argument. If STRING contains
123 any single quote characters, you must quote each of them as
124 well. For example, to pass the option -env NAME O'Keeffe to
125 "erl" from a Bourne-compatible shell:
126
127 --erlarg "-env NAME O\'Keeffe"
128
129
130 --id ID
131 This flag sets the id. If we're starting a daemon (or an inter‐
132 active system) it gives the Yaws server the identity ID. This
133 means that the server will write all internal files into the
134 directory $HOME/.yaws/yaws/ID.
135
136 Yaws also creates a file called $HOME/.yaws/yaws/ID/CTL which
137 contains the portnumber the daemon is listening on for control
138 request by the control command such as "yaws --hup" etc.
139
140 If we're invoking a control command which should perform some
141 control function on the daemon, we may have to give the --id
142 flag also to the control command. If we don't do this the con‐
143 trol command may interact with the wrong daemon due to finding
144 the wrong "ctl" file.
145
146 The daemon may also optionally specify the "id" in the yaws.conf
147 configuration file.
148
149
150 --umask MASK
151 Set the umask for the daemon to MASK.
152
153
154 --encoding latin|unicode
155 Set the config file encoding (default: latin1).
156
157
159 The following list of options are are used to control the daemon from
160 the "outside" while it is running.
161
162
163 --hup [--id ID]
164 HUP the daemon. This forces the daemon to reread the configura‐
165 tion file. It also makes the daemon empty all its internal con‐
166 tent caches. Hence when updating the doc root, HUPing the dae‐
167 mon is the fastest way to see the content updates.
168
169 --stop [--id id]
170 Stop the daemon (called id)
171
172 --ls Lists current ids and status of all yaws servers on localhost.
173 In practice this amounts to a listdir in $HOME/.yaws/yaws - and
174 check whether the different systems who has created files there
175 are alive.
176
177 --status [--id id]
178 Query a running yaws daemon for its status, and print it.
179
180 --stats [--id id]
181 Query a running yaws daemon for its statistics, and print it.
182
183 --running-config [--id id]
184 Query a running yaws daemon for its current configuration, and
185 print it. This can be useful when attempting to figure out how
186 to set config in embedded mode. Configure yaws to you liking in
187 non-embedded mode, run this command and use the output to popu‐
188 late the embedded mode records.
189
190 --load Modules [--id id]
191 Try to (re)load erlang modules into a running daemon. This is
192 useful after modifying appmods or modules used by scripts.
193
194
195 --debug-dump [--id id]
196 Produce a debug dump on stdout. In particular this code lists
197 what we refer to as suspicious processes. I.e. processes that
198 might be hanging or processes that are "large" - hardcoded to
199 40k words.
200
201
202 --ctltrace [--id ID] http | traffic | off
203 Control the trace capabilities of a running yaws daemon. If the
204 http or traffic option is given, the daemon will write a log for
205 debug purposes into the logdir.
206
207
208 --wait-started[=T] [--id ID]
209 Waits at most 30 seconds for the server to start. Exits with 0
210 if server is running, 1 otherwise. Typically useful in test
211 scripts. The default 30 seconds can be modified by appending =T
212 to the option, where T is the desired number of seconds to wait
213 for the server to start.
214
215
217 --check YawsFile [IncDirs ....]
218 Test compile a `.yaws' file. Useful in Makefiles when we want to
219 ensure that all .yaws files are syntactically correct
220
221 --version
222 output version information and exit
223
224
226 HOME Is used to determine where we write the temporary files. By
227 default all tmp files end up in $HOME/.yaws. This includes the
228 JIT files that are the result of processed .yaws files and also
229 the so called control file that is used by the daemon to write
230 the port number to which it is listening for control commands
231 such as "yaws --status"
232
233 Thus HOME is the handle we use in the control commands to find
234 the control file so that we know where to connect to.
235
236
237 YAWSHOME
238 Can be used to override the HOME variable. This is useful when
239 we for example are running yaws under port binding programs such
240 as authpriv.
241
242 It's useful by distros that don't want Yaws to write any files
243 ever in the HOME directory of root.
244
245
246
247
249 Written by Claes Wikstrom
250
252 yaws.conf(5) erl(1)
253
254
255
256 YAWS(1)