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
155 The following list of options are are used to control the daemon from
156 the "outside" while it is running.
157
158
159 --hup [--id ID]
160 HUP the daemon. This forces the daemon to reread the configura‐
161 tion file. It also makes the daemon empty all its internal con‐
162 tent caches. Hence when updating the doc root, HUPing the dae‐
163 mon is the fastest way to see the content updates.
164
165 --stop [--id id]
166 Stop the daemon (called id)
167
168 --ls Lists current ids and status of all yaws servers on localhost.
169 In practice this amounts to a listdir in $HOME/.yaws/yaws - and
170 check whether the different systems who has created files there
171 are alive.
172
173 --status [--id id]
174 Query a running yaws daemon for its status, and print it.
175
176 --stats [--id id]
177 Query a running yaws daemon for its statistics, and print it.
178
179 --running-config [--id id]
180 Query a running yaws daemon for its current configuration, and
181 print it. This can be useful when attempting to figure out how
182 to set config in embedded mode. Configure yaws to you liking in
183 non-embedded mode, run this command and use the output to popu‐
184 late the embedded mode records.
185
186 --load Modules [--id id]
187 Try to (re)load erlang modules into a running daemon. This is
188 useful after modifying appmods or modules used by scripts.
189
190
191 --debug-dump [--id id]
192 Produce a debug dump on stdout. In particular this code lists
193 what we refer to as suspicious processes. I.e. processes that
194 might be hanging or processes that are "large" - hardcoded to
195 40k words.
196
197
198 --ctltrace [--id ID] http | traffic | off
199 Control the trace capabilities of a running yaws daemon. If the
200 http or traffic option is given, the daemon will write a log for
201 debug purposes into the logdir.
202
203
204 --wait-started[=T] [--id ID]
205 Waits at most 30 seconds for the server to start. Exits with 0
206 if server is running, 1 otherwise. Typically useful in test
207 scripts. The default 30 seconds can be modified by appending =T
208 to the option, where T is the desired number of seconds to wait
209 for the server to start.
210
211
213 --check YawsFile [IncDirs ....]
214 Test compile a `.yaws' file. Useful in Makefiles when we want to
215 ensure that all .yaws files are syntactically correct
216
217 --version
218 output version information and exit
219
220
222 HOME Is used to determine where we write the temporary files. By
223 default all tmp files end up in $HOME/.yaws. This includes the
224 JIT files that are the result of processed .yaws files and also
225 the so called control file that is used by the daemon to write
226 the port number to which it is listening for control commands
227 such as "yaws --status"
228
229 Thus HOME is the handle we use in the control commands to find
230 the control file so that we know where to connect to.
231
232
233 YAWSHOME
234 Can be used to override the HOME variable. This is useful when
235 we for example are running yaws under port binding programs such
236 as authpriv.
237
238 It's useful by distros that don't want Yaws to write any files
239 ever in the HOME directory of root.
240
241
242
243
245 Written by Claes Wikstrom
246
248 yaws.conf(5) erl(1)
249
250
251
252 YAWS(1)