1YAWS.CONF(5) User Commands YAWS.CONF(5)
2
3
4
6 /etc/yaws/yaws.conf - Configuration file for the yaws web server
7
9 Yaws is fast lightweight web server. It reads a configuration file
10 called yaws.conf to control its operations. The configuration contains
11 two distinct parts a global part which affects all the virtual hosts
12 and a server part where options for each virtual host is supplied.
13
14
16 logdir = Directory
17 All yaws logs will be written to files in this directory. There
18 are several different log files written by yaws.
19
20 report.log - this is a text file that contains all error logger
21 printouts from yaws.
22
23 Host.access - for each virtual host served by yaws, a file
24 Host.access will be written which contains an access log in Com‐
25 mon Log Format.
26
27 trace.http - this file contains the HTTP trace if that is
28 enabled
29
30 auth.log - If configured, all http auth related messages goes
31 here.
32
33 trace.traffic - this file contains the traffic trace if that is
34 enabled
35
36 The default value for logdir is "."
37
38
39 ebin_dir = Directory
40 This directive adds Directory to the Erlang search path. It is
41 possible to have several of these command in the configuration
42 file. The default value is "yaws_dir"/examples/ebin
43
44
45
46 id = String
47 It is possible run multiple yaws servers on the same machine. We
48 use the id of a yaws server to control it using the different
49 control commands such as:
50
51 # /usr/local/bin/yaws --id foobar --stop
52
53 To stop the Yaws server with id "foobar". Each Yaws server will
54 write its internals data into a file called $HOME/.yaws/yaws/ID
55 where ID the identity of the server. Yaws also creates a file
56 called ${VARDIR}/run/yaws/ctl-${ID} which contain the port num‐
57 ber where the server is listening for control commands. The
58 default id is "default".
59
60
61 include_dir = Directory
62 This directive adds Directory to the path of directories where
63 the Erlang compiler searches for include files. We need to use
64 this if we want to include .hrl files in our yaws Erlang code.
65 The default value is "yaws_dir"/examples/include.
66
67
68 max_num_cached_files = Integer
69 Yaws will cache small files such as commonly accessed GIF images
70 in RAM. This directive sets a maximum number on the number of
71 cached files. The default value is 400.
72
73 max_num_cached_bytes = Integer
74 This directive controls the total amount of RAM which can maxi‐
75 mally be used for cached RAM files. The default value is
76 1000000, 1 megabyte.
77
78 max_size_cached_file = Integer
79 This directive sets a maximum size on the files that are RAM
80 cached by yaws. The default value i 8000, 8 kBytes.
81
82 cache_refresh_secs = Integer
83 The RAM cache is used to serve pages that sit in the cache. An
84 entry sits in cache at most cache_refresh_secs number of sec‐
85 onds. The default is 30. This means that when the content is
86 updated under the docroot, that change doesn't show until 30
87 seconds have passed. While developing a yaws site, it may be
88 convenient to set this value to 0. If the debug flag (-d) is
89 passed to the yaws start script, this value is automatically set
90 to 0.
91
92
93 trace = false | traffic | http
94 This enables traffic or http tracing. Tracing is also possible
95 to enable with a command line flag to yaws. Default is false.
96
97
98 use_old_ssl = true | false
99 This re-enables the old OTP ssl implementation. By default we
100 use the new ssl implementation.
101
102
103 auth_log = true | false
104 Enable or disable the auth log. Default is true.
105
106
107 max_connections = nolimit | Integer
108 Set this value to control the maximum number of connections from
109 HTTP clients into the server. This is implemented by closing the
110 last socket if the limit threshold is reached.
111
112
113 keepalive_maxuses = nolimit | Integer
114 Normally, yaws does not restrict the number of times a connec‐
115 tion is kept alive using keepalive. Setting this parameter to an
116 integer X will ensure that connections are closed once they have
117 been used X times. This can be a useful to guard against long
118 running connections collecting too much garbage in the Erlang
119 VM.
120
121
122 process_options = "[]" | "[{fullsweep_after, int()} | {min_heap_size,
123 int()}]"
124 Override the garbage collection option parameters for processes
125 that handle new connections. Useful for systems that expect
126 long-lived connections that handle a lot of data. The default
127 value is Erlang's default which does minimal garbage collection
128 until the process dies. The value type is a quoted string which
129 contains an Erlang property list. See Erlang's
130 erlang:spawn_opt/4 function for more details.
131
132
133 log_wrap_size = Integer
134 The logs written by yaws are all wrap logs, the default value at
135 the size where they wrap around and the original gets renamed to
136 File.old is 1000000, 1 megabyte. This value can changed.
137
138 If we set the value to 0 the logs will never wrap. If we want to
139 use Yaws in combination with a more traditional log wrapper such
140 as logrotate, set the size to 0 and Yaws will reopen the log‐
141 files once they have be renamed/removed.
142
143
144 log_resolve_hostname = true | false
145 By default the client host IP is not resolved in the access
146 logs.
147
148
149
150 fail_on_bind_err = true | false
151 Fail completely or not if yaws fails to bind a listen socket
152 Default is true.
153
154
155 enable_soap = true | false
156 If true, a soap server will be started at startup of Yaws.
157 Default is false.
158
159
160 soap_srv_mods = ListOfModuleSetting
161 If enable_soap is true, a startup yaws will invoke
162 yaws_soap_srv:setup() to setup modules set here. ModuleSetting
163 is either a triad like <Mod, HandlerFunc, WsdlFile> or a quadru‐
164 ple form like <Mod, HandlerFunc, WsdlFile, Prefix> which speci‐
165 fies the prefix. A prefix will be used as argument of
166 yaws_soap_lib:initModel() and then be used as a XML namespace
167 prefix. Note, the WsdlFile here should be an absolute-path file
168 in local file systems.
169
170 For example, we can specify
171
172 soap_srv_mods=<Mod1, HandlerFunc, WsdlFile1><Mod2, Handler‐
173 Func, WsdlFile2, SpecifiedPrefix>...
174
175
176 php_exe_path = Path
177 The name of (and possibly path to) the php executable used to
178 interpret php scripts (if allowed). Default is php_exe_path =
179 php-cgi.
180
181
182 copy_error_log = true | false
183 Enable or disable copying of the error log. When we run in
184 embedded mode, there may very well be some other systems process
185 that is responsible for writing the errorlog to a file whereas
186 when we run in normal standalone mode, we typically want the
187 Erlang errorlog written to a report.log file. Default value is
188 true.
189
190
191
192 runmod = ModuleName
193 At startup yaws will invoke ModuleName:start() in a separate
194 process. It is possible to have several runmods. This is useful
195 if we want to reuse the yaws startup shell script for our own
196 application.
197
198
199 pick_first_virthost_on_nomatch = true | false
200 When Yaws gets a request, it extracts the Host: header from the
201 client request to choose a virtual server amongst all servers
202 with the same IP/Port pair. This configuration parameter
203 decides whether yaws should pick the first (as defined in the
204 yaws.conf file) if no name match or not. In real live hosting
205 scenarios we typically want this to be false whereas in test‐
206 ing/development scenarios it may be convenient to set it to
207 true. Default is true.
208
209
210 keepalive_timeout = TimeInMilliseconds | infinity
211 If the HTTP session will be kept alive (i.e., not immediately
212 closed) it will close after keepalive_timeout milliseconds
213 unless a new request is received in that time. The default value
214 is 30000. The value infinity is legal but not recommended.
215
216
217 use_fdsrv = true | false
218 This feature makes it possible to bind to ports < 1024 even when
219 we're not running as root. It requires the Jungerl package
220 called fd_server to be properly installed. The feature doesn't
221 work with SSL. Default is false. The use of fdsrv is not
222 encouraged, see http://yaws.hyber.org/privbind.yaws
223
224
225 subconfig = File
226 Load specified config file.
227
228
229 subconfigdir = Directory
230 Load all config file in specified directory.
231
232
233
235 Yaws can virthost several web servers on the same IP address as well as
236 several web servers on different IP addresses. This includes SSL
237 servers. Each virtual host is defined within a matching pair of
238 <server ServerName> and </server>. The ServerName will be the name of
239 the webserver.
240
241 The following directives are allowed inside a server definition.
242
243 port = Port
244 This makes the server listen on Port. Default is 8000.
245
246 listen = IpAddress
247 This makes the server listen on IpAddress When virthosting sev‐
248 eral servers on the same ip/port address, if the browser doesn't
249 send a Host: field, yaws will pick the first server specified in
250 the config file. If the specified ip address is 0.0.0.0 yaws
251 will listen on all local IP addresses on the specified port.
252 Default is 0.0.0.0.
253
254
255 listen_backlog = Integer
256 This sets the TCP listen backlog for the server to define the
257 maximum length the queue of pending connections may grow to. The
258 default is the same as the default provided by gen_tcp:listen/2,
259 which is 5.
260
261
262 rhost = Host[:Port]
263 This forces all local redirects issued by the server to go to
264 Host. This is useful when yaws listens to a port which is dif‐
265 ferent from the port that the user connects to. For example,
266 running yaws as a non-privileged user makes it impossible to
267 listen to port 80, since that port can only be opened by a priv‐
268 ileged user. Instead yaws listens to a high port number port,
269 8000, and iptables are used to redirect traffic to port 80 to
270 port 8000 (most NAT:ing firewalls will also do this for you).
271
272 rscheme = http | https
273 This forces all local redirects issued by the server to use this
274 method. This is useful when an SSL off-loader, or stunnel, is
275 used in front of yaws.
276
277
278 access_log = true | false
279 Setting this directive to false turns of traffic logging for
280 this virtual server. The default value is true.
281
282
283 dir_listings = true | true_nozip | false
284 Setting this directive to false disallows the automatic dir
285 listing feature of Yaws. A status code 403 Forbidden will be
286 sent. Set to true_nozip to avoid the auto-generated all.zip
287 entries. Default is false.
288
289
290 extra_cgi_vars = .....
291 Add additional CGI or FastCGI variables. For example:
292
293 <extra_cgi_vars dir='/path/to/some/scripts'>
294 var = val
295 </extra_cgi_vars>
296
297
298 statistics = true | false
299 Turns on/off statistics gathering for a virtual server. Default
300 is false.
301
302
303 fcgi_app_server = Host:Port
304 The hostname and TCP port number of a FastCGI application
305 server. The TCP port number is not optional. There is no
306 default value.
307
308
309 fcgi_trace_protocol = true | false
310 Enable or disable tracing of FastCGI protocol messages as info
311 log messages. Disabled by default.
312
313
314 fcgi_log_app_error = true | false
315 Enable or disable logging of application error messages (output
316 to stderr and non-zero exit value). Disabled by default.
317
318
319 deflate = true | false
320 Turns on or off deflate compression for a server. Default is
321 false.
322
323
324 docroot = Directory ...
325 This makes the server serve all its content from Directory.
326
327 It is possible to pass a space-separated list of directories as
328 docroot. If this is the case, the various directories will be
329 searched in order for the requested file. This also works with
330 the ssi and yssi constructs where the full list of directories
331 will be searched for files to ssi/yssi include.
332
333
334 auth_skip_docroot = true | false
335 If true, the docroot will not be searched for .yaws_auth files.
336 This is useful when the docroot is quite large and the time to
337 search it is prohibitive when yaws starts up. Defaults to false.
338
339
340 partial_post_size = Integer | nolimit
341 When a yaws file receives large POSTs, the amount of data
342 received in each chunk is determined by the this parameter. The
343 default value is 10240.
344
345
346
347 dav = true | false
348 Turns on the DAV protocol for this server. The dav support in
349 yaws is highly limited. If dav is turned on, .yaws processing of
350 .yaws pages is turned off. Default is false. Setting it to
351 nolimit is potentially dangerous. The socket read timeout is
352 supplied by the keepalive_timeout setting. If the read is not
353 done within the timeout, the POST will fail.
354
355
356 tilde_expand = true|false
357 If this value is set to false yaws will never do tilde expan‐
358 sion. The default is false. tilde_expansion is the mechanism
359 whereby a URL on the form http://www.foo.com/~username is
360 changed into a request where the docroot for that particular
361 request is set to the directory ~username/public_html/ Default
362 is false.
363
364
365 allowed_scripts = ListOfSuffixes
366 The allowed script types for this server. Recognized are
367 `yaws', `cgi', `fcgi', `php'. Default is allowed_scripts = yaws
368 php cgi fcgi.
369
370 Note: for fcgi scripts, the FastCGI application server is only
371 called if a local file with the .fcgi extension exists. However,
372 the contents of the local .fcgi file are ignored.
373
374
375 tilde_allowed_scripts = ListOfSuffixes
376 The allowed script types for this server when executing files in
377 a users public_html folder Recognized are `yaws', `cgi',
378 `fcgi', `php'. Default is tilde_allowed_scripts = i.e. empty
379
380
381
382 appmods = ListOfModuleNames
383 If any the names in ListOfModuleNames appear as components in
384 the path for a request, the path request parsing will terminate
385 and that module will be called. There is also an alternate syn‐
386 tax for specifying the appmods if we don't want our internal
387 erlang module names to be exposed in the URL paths. We can
388 specify
389
390 appmods = <Path1, Module1> <Path2, Modules2> ...
391
392 Assume for example that we have the URL
393 http://www.hyber.org/myapp/foo/bar/baz?user=joe while we have
394 the module foo defined as an appmod, the function foo:out(Arg)
395 will be invoked instead of searching the filesystems below the
396 point foo.
397
398 The Arg argument will have the missing path part supplied in its
399 appmoddata field.
400
401 It is also possible to exclude certain directories from appmod
402 processing. This is particulaly interesting for '/' appmods.
403 Here is an example:
404
405 appmods = </, myapp exclude_paths icons js top/static>
406
407 The above configuration will invoke the 'myapp' erlang module on
408 everything except any file found in directories, 'icons', 'js'
409 and 'top/static' relative to the docroot.
410
411
412
413
414 errormod_404 = Module
415 It is possible to set a special module that handles 404 Not
416 Found messages.
417
418 The function Module:out404(Arg, GC, SC) will be invoked. The
419 arguments are
420
421 Arg is a #arg{} record
422
423 GC is a #gconf{} record (defined in yaws.hrl)
424
425 SC is a #sconf{} record (defined in yaws.hrl)
426
427 The function can and must do the same things that a normal out/1
428 does.
429
430
431 errormod_401 = Module
432 It is possible to set a special module that handles 401 Unautho‐
433 rized messages. This can for example be used to display a login
434 page instead.
435
436 The function Module:out401(Arg) will be invoked. The arguments
437 are
438
439 Arg is a #arg{} record
440
441 The function can and must do the same things that a normal out/1
442 does.
443
444
445
446 errormod_crash = Module
447 It is possible to set a special module that handles the HTML
448 generation of server crash messages. The default is to display
449 the entire formated crash message in the browser. This is good
450 for debugging but not in production.
451
452 The function Module:crashmsg(Arg, SC, Str) will be called. The
453 Str is the real crash message formated as a string.
454
455 The function must return, {content,MimeType,Cont} or {html, Str}
456 or {ehtml, Term}. That data will be shipped to the client.
457
458
459 arg_rewrite_mod = Module
460 It is possible to install a module that rewrites all the Arg
461 #arg{} records at an early stage in the yaws server. This can
462 be used to do various things such as checking a cookie, rewrit‐
463 ing paths etc.
464
465
466 start_mod = Module
467 Defines a user provided callback module. At startup of the
468 server, Module:start/1 will be called. The #sconf{} record
469 (defined in yaws.hrl) will be used as the input argument. This
470 makes it possible for a user application to syncronize the
471 startup with the yaws server as well as getting hold of user
472 specific configuration data, see the explanation for the
473 <opaque> context.
474
475
476 revproxy = Prefix Url
477 Make yaws a reverse proxy. The Prefix is a path inside our own
478 docroot and the Url argument is an url pointing to a website we
479 want to "mount" under the path which is Prefix.
480
481 Example: revproxy = /tmp/foo http://yaws.hyber.org
482
483 Makes the hyber website appear under /tmp/foo
484
485 It is possible to have multiple reverse proxies inside the same
486 server.
487
488 WARNING, this feature is yet not in production quality.
489
490
491 fwdproxy = true|false
492 Make yaws a forward proxy. By enabling this option you can use
493 yaws as a proxy for outgoing web traffic, typically by configur‐
494 ing the proxy settings in a web-browser to explicitly target
495 yaws as its proxy server.
496
497 WARNING, this feature is yet not in production quality.
498
499
500 servername = Name
501 If we're virthosting everal servers and want to force a server
502 to match specific Host: headers we can do this with the "server‐
503 name" directive. This name doesn't necessarily have to be the
504 same as the the name inside <server Name> in certain NAT scenar‐
505 ios. Rarely used feature.
506
507
508 phpfcgi = Host:Port
509
510 Use the specified fastcgi server to interpret .php files. This
511 allows for faster execution than through the standard CGI inter‐
512 face, because the PHP interpreter does not have to be restarted
513 for every request. It also makes it possible to use a separate
514 PHP interpreter for each <server>, possibly running in different
515 user contexts and with different memory and CPU restrictions.
516
517 Yaws does not start the PHP interpreter in fastcgi mode for you.
518 To run PHP in fastcgi mode, call it with the -b option. For
519 example:
520
521 php5-cgi -b '127.0.0.1:54321'
522
523 This starts a php5 in fastcgi mode listening on the local net‐
524 work interface. To make use of this PHP server from yaws, spec‐
525 ify:
526
527 phpfcgi = 127.0.0.1:54321
528
529 The PHP interpreter needs read access to the files it is to
530 serve. Thus, if you run it in a different security context than
531 yaws itself, make sure it has access to the .php files.
532
533 Please note that anyone who is able to connect to the php
534 fastcgi server directly can use it to read any file to which it
535 has read access. You should consider this when setting up a sys‐
536 tem with several mutually untrusted instances of php.
537
538
539 <ssl> .... </ssl>
540 This begins and ends an SSL configuration for this server. It's
541 possible to virthost several SSL servers on the same IP given
542 that they all share the same certificate configuration. In gen‐
543 eral it is complicated to virthost several SSL servers on the
544 same IP address since the certificate is typically bound to a
545 domainname in the common name part of the certificate. One
546 solution (the only?) to this problem is to have a certificate
547 with multiple subjectAltNames. See http://wiki.cacert.org/Vhost‐
548 TaskForce#Interoperability_Test
549
550
551 keyfile = File
552 Specifies which file contains the private key for the certifi‐
553 cate. If not specified then the certificate file will be used.
554
555 certfile = File
556 Specifies which file contains the certificate for the server.
557
558 cacertfile = File
559 A file containing trusted certificates to use during client
560 authentication and to use when attempting to build the server
561 certificate chain. The list is also used in the list of accept‐
562 able client CAs passed to the client when a certificate is
563 requested.
564
565 verify = 1 | 2 | 3
566 Specifies the level of verification the server does on client
567 certs. 1 means nothing, 2 means the the server will ask the
568 client for a cert but not fail if the client does not supply a
569 client cert, 3 means that the server requires the client to sup‐
570 ply a client cert.
571
572 depth = Int
573 Specifies the depth of certificate chains the server is prepared
574 to follow when verifying client certs. For the OTP new ssl
575 implementation it is also used to specify how far the server,
576 i.e. we, shall follow the SSL certificates we present to the
577 clients. Hence, using self signed certs, we typically need to
578 set this to 0.
579
580 password = String
581 String If the private key is encrypted on disc, this password is
582 the 3Dee key to decrypt it.
583
584 ciphers = String
585 This string specifies the SSL cipher string. The syntax of the
586 SSL cipher string is a little horrible sublanguage of its own.
587 It is documented in the ssl man page for "ciphers".
588
589 </ssl> Ends an SSL definition
590
591
592 <redirect> ... </redirect>
593 Defines a redirect mapping. The following items are allowed
594 within a matching pair of <redirect> and </redirect> delimiters.
595
596 We can have a series of
597
598 Path = URL or
599
600 Path = file
601
602 All accesses to Path will be redirected to URL/Path or alterna‐
603 tively to scheme:host:port/file/Path if a file is used. Note
604 that the original path is appended to the redirected url. So if
605 we for example have:
606
607 <redirect>
608 /foo = http://www.mysite.org/zapp
609 /bar = /tomato.html
610 </redirect>
611
612 Asumming this config resides on a site called http://abc.com, We
613 have the following redirects:
614
615 http://abc.com/foo -> http://www.mysite.org/zapp/foo
616
617 http://abc.com/foo/test -> http://www.mysite.org/zapp/foo/test
618
619 http://abc.com/bar -> http://abc.com/bar
620
621 http://abc.com/bar/x/y/z -> http://abc.com/bar/x/y/z
622
623 Sometimes we do not want to have the original path appended to
624 the redirected path. To get that behaviour we specify the config
625 with '==' instead of '='.
626
627 <redirect>
628 /foo == http://www.mysite.org/zapp
629 /bar = /tomato.html </redirect>
630
631 Now a request for http://abc.com/foo/x/y/z simply gets redi‐
632 rected to http://www.mysite.org/zapp. This is typically used
633 when we simply want a static redirect at some place in the doc‐
634 root.
635
636 When we specify a file as target for the redirect, the redir
637 will be to the current http(s) server.
638
639
640
641 <auth> ... </auth>
642 Defines an auth structure. The following items are allowed
643 within a matching pair of <auth> and </auth> delimiters.
644
645
646 dir = Dir
647 Makes Dir to be controlled by WWW-authenticate headers. In order
648 for a user to have access to WWW-Authenticate controlled direc‐
649 tory, the user must supply a password. The Dir must be specified
650 relative to the docroot.
651
652
653 realm = Realm
654 In the directory defined here, the WWW-Authenticate Realm is set
655 to this value.
656
657
658 authmod = AuthMod
659 If an auth module is defined then AuthMod:auth(Arg, Auth) will
660 be called for all access to the directory. The auth/2 function
661 should return one of: true, false, {false, Realm}, {appmod,
662 Mod}. If {appmod, Mod} is returned then a call to Mod:out(Arg)
663 will be used to deliver the content.
664
665 This can, for example, be used to implement cookie authentica‐
666 tion. The auth() callback would check if a valid cookie header
667 is present, if not it would return {appmod, ?MODULE} and the
668 out/1 function in the same module would return {redirect_local,
669 "/login.html"}.
670
671
672 user = User:Password
673 Inside this directory, the user User has access if the user sup‐
674 plies the password Password in the popup dialogue presented by
675 the browser. We can obviously have several of these value
676 inside a single <auth> </auth> pair.
677
678 The usage of User:Password in the actual config file is depre‐
679 cated as of release 1.51. It is preferred to have the users in a
680 file called .yaws_auth in the actual directory. The .yaws_auth
681 file has to be file parseable by file:consult/1
682
683 Each row of the file must contain terms on the form
684
685 {User, Password}.
686
687 Where both User and Password should be strings. The .yaws_auth
688 file mechanism is not (yet) recursive. Thus any subdirectories
689 to Dir are not automatically also protected.
690
691 The .yaws_auth file is never visible in a dir listing
692
693
694 pam service = pam-service
695 If the item pam is part of the auth structure, Yaws will also
696 try to authenticate the user using "pam" using the pam service
697 indicated. Usual services are typically found under /etc/pam.d.
698 Usual values are "system-auth" etc.
699
700 pam authentication is performed by an Erlang port program which
701 is typically installed as suid root by the yaws install script.
702
703
704 </auth>
705 Ends an auth definition
706
707
708 <opaque> .... </opaque>
709 This begins and ends an opaque configuration context for this
710 server, where 'Key = Value' directives can be specified. These
711 directives are ignored by yaws (hence the name opaque), but can
712 be accessed as a list of tuples {Key,Value} stored in the
713 #sconf.opaque record entry. See also the description of the
714 start_mod directive.
715
716 This mechanism can be used to pass data from a surrounding
717 application into the individual .yaws pages.
718
719
720
721
722
724 The following example defines a single server on port 80.
725
726 logdir = /var/log/yaws
727 <server www.mydomain.org>
728 port = 80
729 listen = 192.168.128.31
730 docroot = /var/yaws/www
731 </server>
732
733 And this example shows a similar setup but two web servers on the same
734 IP address.
735
736
737 logdir = /var/log/yaws
738 <server www.mydomain.org>
739 port = 80
740 listen = 192.168.128.31
741 docroot = /var/yaws/www
742 </server>
743
744 <server www.funky.org>
745 port = 80
746 listen = 192.168.128.31
747 docroot = /var/yaws/www_funky_org
748 </server>
749
750
751
752
753 An example with www-authenticate and no access logging at all.
754
755 logdir = /var/log/yaws
756 <server www.mydomain.org>
757 port = 80
758 listen = 192.168.128.31
759 docroot = /var/yaws/www
760 access_log = false
761 <auth>
762 dir = secret/dir1
763 realm = foobar
764 user = jonny:verysecretpwd
765 user = benny:thequestion
766 user = ronny:havinganamethatendswithy
767 </auth>
768
769 </server>
770
771
772
773
774
775
776 An example specifying a user defined module to be called
777 at startup, as well as some user specific configuration.
778
779 <server www.funky.org>
780 port = 80
781 listen = 192.168.128.31
782 docroot = /var/yaws/www_funky_org
783 start_mod = btt
784 <opaque>
785 mydbdir = /tmp
786 mylogdir = /tmp/log
787 </opaque>
788 </server>
789
790
791
792 An example specifying the GSSAPI/SPNEGO module (authmod_gssapi) to be
793 used for authentication. This module requires egssapi version 0.1~pre2
794 or later available at http://www.hem.za.org/egssapi/.
795
796 The Kerberos5 keytab is specified as 'keytab = File' directive in
797 opaque. This keytab should contain the keys of the HTTP service princi‐
798 pal, 'HTTP/www.funky.org' in this example.
799
800
801 <server www.funky.org>
802 port = 80
803 listen = 192.168.128.31
804 docroot = /var/yaws/www_funky_org
805 start_mod = authmod_gssapi
806 <auth>
807 authmod = authmod_gssapi
808 dir = secret/dir1
809 </auth>
810 <opaque>
811 keytab = /etc/yaws/http.keytab
812 </opaque>
813 </server>
814
815
816
817
818 And finally a slightly more complex example with two servers on the
819 same IP, and one SSL server on a different IP.
820
821 When there are more than one server on the same IP, and they have dif‐
822 ferent names the server must be able to choose one of them if the
823 client doesn't send a Host: header. yaws will choose the first one
824 defined in the conf file.
825
826
827 logdir = /var/log/yaws
828 max_num_cached_files = 8000
829 max_num_cached_bytes = 6000000
830
831 <server www.mydomain.org>
832 port = 80
833 listen = 192.168.128.31
834 docroot = /var/yaws/www
835 </server>
836
837
838
839 <server www.funky.org>
840 port = 80
841 listen = 192.168.128.31
842 docroot = /var/yaws/www_funky_org
843 </server>
844
845 <server www.funky.org>
846 port = 443
847 listen = 192.168.128.32
848 docroot = /var/yaws/www_funky_org
849 <ssl>
850 keyfile = /etc/funky.key
851 certfile = /etc/funky.cert
852 password = gazonk
853 </ssl>
854 </server>
855
856
857
858 Finally an example with virtual directories, vdirs.
859
860
861 <server server.domain>
862 port = 80
863 listen = 192.168.128.31
864 docroot = /var/yaws/www
865 arg_rewrite_mod = yaws_vdir
866 <opaque>
867 vdir = "/virtual1/ /usr/local/somewhere/notrelated/to/main/docroot"
868 vdir = "/myapp/ /some/other/path can include/spaces"
869 vdir = "/icons/ /usr/local/www/yaws/icons"
870 </opaque>
871 </server>
872
873
874 The first defined vdir can then be accessed at or under
875 http://server.domain/virtual1/ or http://server.domain/virtual1
876
877
878
879
881 Written by Claes Wikstrom
882
884 yaws(1) erl(1)
885
886 Comment] Local Variables: Comment] mode: nroff Comment] End:
887
888
889
890 YAWS.CONF(5)