-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathConfiguration.html
More file actions
707 lines (706 loc) · 45.1 KB
/
Copy pathConfiguration.html
File metadata and controls
707 lines (706 loc) · 45.1 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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8"/>
<meta name="generator" content="Docutils 0.13.1: http://docutils.sourceforge.net/" />
<title>Configuration Guide</title>
<link rel="stylesheet" href="../../Docs/Doc.css" type="text/css" />
</head>
<body>
<div class="document" id="configuration-guide">
<h1 class="title">Configuration Guide</h1>
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#command-line-configuration" id="id5">Command Line Configuration</a></p></li>
<li><p><a class="reference internal" href="#application-config" id="id6">Application.config</a></p>
<ul>
<li><p><a class="reference internal" href="#general-settings" id="id7">General Settings</a></p></li>
<li><p><a class="reference internal" href="#path-handling" id="id8">Path Handling</a></p></li>
<li><p><a class="reference internal" href="#sessions" id="id9">Sessions</a></p></li>
<li><p><a class="reference internal" href="#caching" id="id10">Caching</a></p></li>
<li><p><a class="reference internal" href="#errors" id="id11">Errors</a></p></li>
<li><p><a class="reference internal" href="#logging" id="id12">Logging</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#appserver-config" id="id13">AppServer.config</a></p></li>
</ul>
</div>
<div class="section" id="command-line-configuration">
<h1>Command Line Configuration</h1>
<p>Each of these can be set in the <span class="docutils literal">.config</span> files, but they can be overridden
with the command line. Run <span class="docutils literal">AppServer</span> with switches in the form
<span class="docutils literal">ClassName.SettingName=value</span>, e.g. <span class="docutils literal">AppServer.AdapterPort=8087</span>.</p>
<p>The <span class="docutils literal">value</span> is coerced into a Python type: if it starts with one of the
characters <span class="docutils literal"><span class="pre">({["'</span></span> -- i.e., parenthesis (expression), dictionary, list,
or string -- then the value with be eval'ed. If it can be turned into a
Boolean, integer, float or None, then it will be converted, otherwise it will
be left as a string. Some examples:</p>
<ul class="simple">
<li><p><span class="docutils literal">None</span> == None</p></li>
<li><p><span class="docutils literal">True</span> == True (evaluates to 1 in older Python versions)</p></li>
<li><p><span class="docutils literal">1</span> == 1</p></li>
<li><p><span class="docutils literal">127.0.0.1</span> == "127.0.0.1"</p></li>
<li><p><span class="docutils literal">(10+2)</span> == 12</p></li>
<li><p><span class="docutils literal">{'a': 'b'}</span> == {'a': 'b'}</p></li>
<li><p><span class="docutils literal">{a: b}</span> == <em>error</em></p></li>
<li><p><span class="docutils literal">[1, 'c', [2, 3]]</span> == [1, 'c', [2, 3]]</p></li>
</ul>
<p>Be careful about special characters in the shell. All the characters
<span class="docutils literal">() [] ' "</span> are special, and need to be quoted (with <span class="docutils literal">\</span> or with single
or double quotation marks).</p>
</div>
<div class="section" id="application-config">
<h1>Application.config</h1>
<p><span class="docutils literal">Application.config</span> covers not only the application, but a number
of components that use it as a central point of configuration.</p>
<div class="section" id="general-settings">
<h2>General Settings</h2>
<dl>
<dt><span class="docutils literal">Contexts</span>:</dt>
<dd><p>This dictionary maps context names to the directory holding the
context content. Since the default contexts all reside in WebKit,
the paths are simple and relative. The context name appears as the
first path component of a URL, otherwise <span class="docutils literal"><span class="pre">Contexts['default']</span></span>
is used when none is specified. When creating your own
application, you will add a key such as <span class="docutils literal">"MyApp"</span> with a value
such as <span class="docutils literal">"/home/apps/MyApp"</span>. That directory will then contain
content such as Main.py, SomeServlet.py, SomePage.psp,
etc. <span class="docutils literal">Webware/bin/MakeAppWorkDir.py</span> will set up a context for
your use as well. Default:</p>
<pre class="literal-block">{
'default': 'Examples',
'Admin': 'Admin',
'Examples': 'Examples',
'Docs': 'Docs',
'Testing': 'Testing',
}</pre>
</dd>
<dt><span class="docutils literal">AdminPassword</span>:</dt>
<dd><p>The password that, combined with the <span class="docutils literal">admin</span> id, allows access
to the <span class="docutils literal">AppControl</span> page of the <span class="docutils literal">Admin</span> context. Set
interactively when <span class="docutils literal">install.py</span> is run (no default value).</p>
</dd>
<dt><span class="docutils literal">PrintConfigAtStartUp</span>:</dt>
<dd><p>Print the configuration to the console when AppServer starts.
Default: <span class="docutils literal">True</span> (on).</p>
</dd>
</dl>
</div>
<div class="section" id="path-handling">
<h2>Path Handling</h2>
<p>These configuration settings control which files are exposed to users,
which files are hidden, and some of how those files get chosen.</p>
<dl class="simple">
<dt><span class="docutils literal">DirectoryFile</span>:</dt>
<dd><p>The list of basic filenames that WebKit searches for when serving
up a directory. Note that the extensions are absent since WebKit
will look for a file with any appropriate extension (<span class="docutils literal">.py</span>.,
<span class="docutils literal">.html</span>, <span class="docutils literal">.psp</span>, etc). Default: <span class="docutils literal">["index", "Main"]</span>.</p>
</dd>
<dt><span class="docutils literal">ExtensionsForKid</span>:</dt>
<dd><p>This is the list of extensions for files to be parsed Kid templates.
Default: <span class="docutils literal"><span class="pre">['.kid']</span></span>.</p>
</dd>
<dt><span class="docutils literal">ExtensionsForPSP</span>:</dt>
<dd><p>This is the list of extensions for files to be parsed as PSP.
Default: <span class="docutils literal"><span class="pre">['.psp']</span></span>.</p>
</dd>
<dt><span class="docutils literal">ExtensionsToIgnore</span>:</dt>
<dd><p>This is a list or set of extensions that WebKit will ignore when
autodetecting extensions. Note that this does not prevent WebKit
from serving such a file if the extension is given explicitly in a
URL. Default: <span class="docutils literal"><span class="pre">set(['.pyc',</span> '.pyo', <span class="pre">'.py~',</span> <span class="pre">'.bak'])</span></span>.</p>
</dd>
<dt><span class="docutils literal">ExtensionsToServe</span>:</dt>
<dd><p>This is a list of extensions that WebKit will use exclusively when
autodetecting extensions. Note that this does not prevent WebKit
from serving such a file if it is named explicitly in a URL. If
no extensions are given all extensions will be served (usually
anything but <span class="docutils literal">.py</span> and <span class="docutils literal">.psp</span> will be served as a static
file). Default: <span class="docutils literal">[]</span>.</p>
</dd>
<dt><span class="docutils literal">UseCascadingExtensions</span>:</dt>
<dd><p>If False, WebKit will give a <span class="docutils literal">404 Not Found</span> result if there is
more than one file that could potentially match. If True, then
WebKit will use the <span class="docutils literal">ExtensionCascadeOrder</span> setting to determine
which option to serve. Default: <span class="docutils literal">True</span>.</p>
</dd>
<dt><span class="docutils literal">ExtensionCascadeOrder</span>:</dt>
<dd><p>A list of extensions that WebKit will choose, in order, when files
of the same basename but different extensions are available. Note
that this will have no effect if the extension is given in the
URL. Default: <span class="docutils literal"><span class="pre">[".psp",</span> ".py", ".html"]</span>.</p>
</dd>
<dt><span class="docutils literal">FilesToHide</span>:</dt>
<dd><p>A list or set of file patterns to protect from browsing. This affects
all requests, and these files cannot be retrieved even when the extension
is given explicitly. Default: <span class="docutils literal"><span class="pre">set([".*",</span> <span class="pre">"*~",</span> "*bak", <span class="pre">"*.tmpl",</span> <span class="pre">"*.pyc",</span> <span class="pre">"*.pyo",</span> <span class="pre">"*.config"])</span></span>.</p>
</dd>
<dt><span class="docutils literal">FilesToServe</span>:</dt>
<dd><p>File patterns to serve from exclusively. If the file being served
for a particular request does not match one of these patterns an
<span class="docutils literal">HTTP 403 Forbidden</span> error will be return. This affects all
requests, not just requests with autodetected extensions. If set
to <span class="docutils literal">[]</span> then no restrictions are placed. Default: <span class="docutils literal">[]</span>.</p>
</dd>
</dl>
</div>
<div class="section" id="sessions">
<h2>Sessions</h2>
<dl>
<dt><span class="docutils literal">MemcachedNamespace</span>:</dt>
<dd><p>The namespace used to prefix all keys from the Webware application
when accessing Memcached servers for storing sessions. You should
change this if you are using the same memcache for different applications.
Default: <span class="docutils literal">'WebwareSession:'</span>.</p>
</dd>
<dt><span class="docutils literal">MemcachedOnIteration</span>:</dt>
<dd><p>This setting determines how Webware behaves when attempting to iterate
over the sessions or clear the session store, when using <span class="docutils literal">Memcached</span>.
If you set it to <span class="docutils literal">Error</span>, this will raise an Exception, when set to
<span class="docutils literal">Warning</span>, it will print a Warning, when set to <span class="docutils literal">None</span>, it will be
ignored (the size of the session store will be always reported as zero).
Default: <span class="docutils literal">Warning</span>.</p>
</dd>
<dt><span class="docutils literal">MemcachedServers</span>:</dt>
<dd><p>This sets the list of Memcached servers used when setting <span class="docutils literal">SessionStore</span>
to <span class="docutils literal">Memcached</span>. Default: <span class="docutils literal">['localhost:11211']</span>.</p>
</dd>
<dt><span class="docutils literal">RedisNamespace</span>:</dt>
<dd><p>The namespace used to prefix all keys from the Webware application
when accessing Redis servers for storing sessions. You should change
this if you are using the same Redis instance for different applications.
Default: <span class="docutils literal">'WebwareSession:'</span>.</p>
</dd>
<dt><span class="docutils literal">RedisHost</span>:</dt>
<dd><p>This sets the Redis host that shall be used when setting <span class="docutils literal">SessionStore</span>
to <span class="docutils literal">Redis</span>. Default: <span class="docutils literal">'localhost'</span>.</p>
</dd>
<dt><span class="docutils literal">RedisPort</span>:</dt>
<dd><p>This sets the port for the Redis connection that shall be used when
setting <span class="docutils literal">SessionStore</span> to <span class="docutils literal">Redis</span>. Default: <span class="docutils literal">6379</span>.</p>
</dd>
<dt><span class="docutils literal">RedisDb</span>:</dt>
<dd><p>This sets the database number for the Redis connection that shall be
used when setting <span class="docutils literal">SessionStore</span> to <span class="docutils literal">Redis</span>. Default: <span class="docutils literal">0</span>.</p>
</dd>
<dt><span class="docutils literal">RedisPassword</span>:</dt>
<dd><p>This sets the password for the Redis connection that shall be
used when setting <span class="docutils literal">SessionStore</span> to <span class="docutils literal">Redis</span>. Default: <span class="docutils literal">None</span>.</p>
</dd>
<dt><span class="docutils literal">SessionModule</span>:</dt>
<dd><p>Can be used to replace the standard WebKit Session module with
something else. Default: <span class="docutils literal">Session</span></p>
</dd>
<dt><span class="docutils literal">SessionStore</span>:</dt>
<dd><p>This setting determines which of five possible session stores is used
by the application: <span class="docutils literal">Dynamic</span>, <span class="docutils literal">File</span>, <span class="docutils literal">Memcached</span>, <span class="docutils literal">Memory</span>,
<span class="docutils literal">Redis</span> or <span class="docutils literal">`Shelve</span>. The <span class="docutils literal">File</span> store always gets sessions from
disk and puts them back when finished. <span class="docutils literal">Memory</span> always keeps all
sessions in memory, but will periodically back them up to disk.
<span class="docutils literal">Dynamic</span> is a good cross between the two, which pushes excessive or
inactive sessions out to disk. <span class="docutils literal">Shelve</span> stores the sessions in a
database file using the Python <span class="docutils literal">shelve</span> module, <span class="docutils literal">Memcached</span> stores
them on a Memcached system using the <span class="docutils literal"><span class="pre">python-memcached</span></span> interface,
and <span class="docutils literal">Redis</span> stores them on a Redis system using the <span class="docutils literal"><span class="pre">redis-py</span></span> client.
You can use a custom session store module as well. Default: <span class="docutils literal">Dynamic</span>.</p>
</dd>
<dt><span class="docutils literal">SessionStoreDir</span>:</dt>
<dd><p>If <span class="docutils literal">SessionStore</span> is set to <span class="docutils literal">File</span>, <span class="docutils literal">Dynamic</span> or <span class="docutils literal">Shelve</span>,
then this setting determines the directory where the files for the
individual sessions or the shelve database will be stored. The path
is interpreted as relative to the working directory (or WebKit path,
if you're not using a working directory), or you can specify an
absolute path. Default: <span class="docutils literal">Sessions</span>.</p>
</dd>
<dt><span class="docutils literal">SessionTimeout</span>:</dt>
<dd><p>Determines the amount of time (expressed in minutes) that passes
before a user's session will timeout. When a session times out,
all data associated with that session is lost. Default: <span class="docutils literal">60</span>.</p>
</dd>
<dt><span class="docutils literal">AlwaysSaveSessions</span>:</dt>
<dd><p>If False, then sessions will only be saved if they have been changed.
This is more efficient and avoids problems with concurrent requests
made by the same user if sessions are not shared between these requests,
as is the case for session stores other than <span class="docutils literal">Memory</span> or <span class="docutils literal">Dynamic</span>.
Note that in this case the last access time is not saved either, so
sessions may time out if they are not altered. You can call <span class="docutils literal">setDirty()</span>
on sessions to force saving unaltered sessions in this case. If True,
then sessions will always be saved. Default: <span class="docutils literal">True</span>.</p>
</dd>
<dt><span class="docutils literal">IgnoreInvalidSession</span>:</dt>
<dd><p>If False, then an error message will be returned to the user if
the user's session has timed out or doesn't exist. If True, then
servlets will be processed with no session data. Default: <span class="docutils literal">True</span>.</p>
</dd>
<dt><span class="docutils literal">UseAutomaticPathSessions</span>:</dt>
<dd><p>If True, then the app server will include the session ID in the
URL by inserting a component of the form <span class="docutils literal">_SID_=8098302983</span> into
the URL, and will parse the URL to determine the session ID. This
is useful for situations where you want to use sessions, but it
has to work even if the users can't use cookies. If you use
relative paths in your URLs, then you can ignore the presence of
these sessions variables. The name of the field can be configured
with the setting <span class="docutils literal">SessionName</span>. Default: <span class="docutils literal">False</span>.</p>
</dd>
<dt><span class="docutils literal">UseCookieSessions</span>:</dt>
<dd><p>If True, then the app server will store the session ID in a cookie
with the name set in <span class="docutils literal">SessionName</span>, which is usually <span class="docutils literal">_SID_</span>.
Default: <span class="docutils literal">True</span>.</p>
</dd>
<dt><span class="docutils literal">SessionCookiePath</span>:</dt>
<dd><p>You can specify a path for the session cookie here. <span class="docutils literal">None</span> means
that the servlet path will be used, which is normally the best choice.
If you rewrite the URL using different prefixes, you may have to
specify a fixed prefix for all your URLs. Using the root path '/'
will always work, but may have security issues if you are running less
secure applications on the same server. Default: <span class="docutils literal">None</span>.</p>
</dd>
<dt><span class="docutils literal">SecureSessionCookie</span>:</dt>
<dd><p>If True, then the app server will use a secure cookie for the session
ID if the request was using an HTTPS connection. Default: <span class="docutils literal">True</span>.</p>
</dd>
<dt><span class="docutils literal">MaxDynamicMemorySessions</span>:</dt>
<dd><p>The maximum number of dynamic memory sessions that will be
retained in memory. When this number is exceeded, the least
recently used, excess sessions will be pushed out to disk.
This setting can be used to help control memory requirements,
especially for busy sites. This is used only if the
<span class="docutils literal">SessionStore</span> is set to <span class="docutils literal">Dynamic</span>. Default: <span class="docutils literal">10000</span>.</p>
</dd>
<dt><span class="docutils literal">DynamicSessionTimeout</span>:</dt>
<dd><p>The number of minutes of inactivity after which a session is
pushed out to disk. This setting can be used to help control
memory requirements, especially for busy sites. This is used only
if the <span class="docutils literal">SessionStore</span> is set to <span class="docutils literal">Dynamic</span>. Default: <span class="docutils literal">15</span>.</p>
</dd>
<dt><span class="docutils literal">SessionPrefix</span>:</dt>
<dd><p>This setting can be used to prefix the session IDs with a string.
Possible values are <span class="docutils literal">None</span> (don't use a prefix), <span class="docutils literal">"hostname"</span>
(use the hostname as the prefix), or any other string (use that string
as the prefix). You can use this for load balancing, where each
Webware server uses a different prefix. You can then use <a class="reference external" href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html">mod_rewrite</a>
or other software for load-balancing to redirect each user back to the
server they first accessed. This way the backend servers do not
have to share session data. Default: <span class="docutils literal">None</span>.</p>
</dd>
<dt><span class="docutils literal">SessionName</span>:</dt>
<dd><p>This setting can be used to change the name of the field holding
the session ID. When the session ID is stored in a cookie and there
are applications running on different ports on the same host, you
should choose different names for the session IDs, since the web
browsers usually do not distinguish the ports when storing cookies
(the port cookie-attribute introduced with RFC 2965 is not used).
Default: <span class="docutils literal">_SID_</span>.</p>
</dd>
<dt><span class="docutils literal">ExtraPathInfo</span>:</dt>
<dd><p>When enabled, this setting allows a servlet to be followed by
additional path components which are accessible via HTTPRequest's
<span class="docutils literal">extraURLPath()</span>. For subclasses of <span class="docutils literal">Page</span>, this would be
<span class="docutils literal"><span class="pre">self.request().extraURLPath()</span></span>. Default: <span class="docutils literal">False</span>.</p>
</dd>
<dt><span class="docutils literal">UnknownFileTypes</span>:</dt>
<dd><p>This setting controls the manner in which WebKit serves "unknown
extensions" such as .html, .css, .js, .gif, .jpeg etc. The default
setting specifies that the servlet matching the file is cached in memory.
You may also specify that the contents of the files shall be cached
in memory if they are not too large.</p>
<p>If you are concerned about performance, use <a class="reference external" href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html">mod_rewrite</a> to avoid
accessing WebKit for static content.</p>
<p>The <span class="docutils literal">Technique</span> setting can be switched to <span class="docutils literal">"redirectSansAdapter"</span>,
but this is an experimental setting with some known problems.</p>
<p>Default:</p>
<pre class="literal-block">{
'ReuseServlets': True, # cache servlets in memory
'Technique': 'serveContent', # or 'redirectSansAdapter'
# If serving content:
'CacheContent': False, # set to True for caching file content
'MaxCacheContentSize': 128*1024, # cache files up to this size
'ReadBufferSize': 32*1024 # read buffer size when serving files
}</pre>
</dd>
</dl>
</div>
<div class="section" id="caching">
<h2>Caching</h2>
<dl class="simple">
<dt><span class="docutils literal">CacheServletClasses</span>:</dt>
<dd><p>When set to False, the AppServer will not cache the classes that
are loaded for servlets. This is for development and debugging.
You usually do not need this, as servlet modules are reloaded if
the file is changed. Default: <span class="docutils literal">True</span> (caching on).</p>
</dd>
<dt><span class="docutils literal">CacheServletInstances</span>:</dt>
<dd><p>When set to False, the app server will not cache the instances that
are created for servlets. This is for development and debugging.
You usually do not need this, as servlet modules are reloaded and
cached instances purged when the servlet file changes.
Default: <span class="docutils literal">True</span> (caching on).</p>
</dd>
<dt><span class="docutils literal">CacheDir</span>:</dt>
<dd><p>This is the name of the directory where things like compiled PSP
or Kid templates are cached. Webware creates a subdirectory for
every plug-in in this directory. The path is interpreted as relative
to the working directory (or WebKit path, if you're not using a working
directory), or you can specify an absolute path. Default: <span class="docutils literal">Cache</span>.</p>
</dd>
<dt><span class="docutils literal">ClearPSPCacheOnStart</span>:</dt>
<dd><p>When set to False, the app server will allow PSP instances to
persist from one AppServer run to the next. If you have PSPs that
take a long time to compile, this can give a speedup. Default:
<span class="docutils literal">False</span> (cache will persist).</p>
</dd>
<dt><span class="docutils literal">ReloadServletClasses</span>:</dt>
<dd><p>During development of an application, servlet classes will be changed
very frequently. The AutoReload mechanism could be used to detect such
changes and to reload modules with changed servlet classes, but it would
cause an app server restart every time a servlet class is changed. So
by default, modules with servlet classes are reloaded without restarting
the server. This can potentially cause problems when other modules are
dependent on the reloaded module because the dependent modules will not
be reloaded. To allow reloading only using the AutoReload mechanism,
you can set <span class="docutils literal">ReloadServletClasses</span> to <span class="docutils literal">False</span> in such cases. Default:
<span class="docutils literal">True</span> (quick and dirty reloading).</p>
</dd>
</dl>
</div>
<div class="section" id="errors">
<h2>Errors</h2>
<dl>
<dt><span class="docutils literal">ShowDebugInfoOnErrors</span>:</dt>
<dd><p>If True, then uncaught exceptions will not only display a message
for the user, but debugging information for the developer as
well. This includes the traceback, HTTP headers, form fields,
environment and process ids. You will most likely want to turn
this off when deploying the site for users. Default: <span class="docutils literal">True</span>.</p>
</dd>
<dt><span class="docutils literal">EnterDebuggerOnException</span>:</dt>
<dd><p>If True, and if the AppServer is running from an interactive
terminal, an uncaught exception will cause the AppServer to
enter the debugger, allowing the developer to call functions,
investigate variables, etc. See python debugger (pdb) docs for
more information. You will certainly want to turn this off when
deploying the site. Default: <span class="docutils literal">False</span> (off).</p>
</dd>
<dt><span class="docutils literal">IncludeEditLink</span>:</dt>
<dd><p>If True, an "[edit]" link will be put next to each line in tracebacks.
That link will point to a file of type
<span class="docutils literal"><span class="pre">application/x-webkit-edit-file</span></span>, which you should configure your
browser to run with <span class="docutils literal">Webware/bin/editfile.py</span>. If you configure
<span class="docutils literal">editfile.py</span> correctly, then it will automatically open the
respective Python module with your favorite Python editor and put
the cursor on the erroneous line. Default: <span class="docutils literal">True</span>.</p>
</dd>
<dt><span class="docutils literal">IncludeFancyTraceback</span>:</dt>
<dd><p>If True, then display a fancy, detailed traceback at the end of
the error page. It will include the values of local variables in
the traceback. This makes use of a modified version of <span class="docutils literal">cgitb.py</span>
which is included with Webware as <span class="docutils literal">CGITraceback.py</span>.
The <a class="reference external" href="http://web.lfw.org/python/">original version</a> was written by Ka-Ping Yee.
Default: <span class="docutils literal">False</span> (off).</p>
</dd>
<dt><span class="docutils literal">FancyTracebackContext</span>:</dt>
<dd><p>The number of lines of source code context to show if
IncludeFancyTraceback is turned on. Default: <span class="docutils literal">5</span>.</p>
</dd>
<dt><span class="docutils literal">UserErrorMessage</span>:</dt>
<dd><p>This is the error message that is displayed to the user when an
uncaught exception escapes a servlet. Default: <span class="docutils literal">"The site is having technical difficulties with this page. An error has been logged, and the problem will be fixed as soon as possible. Sorry!"</span></p>
</dd>
<dt><span class="docutils literal">ErrorLogFilename</span>:</dt>
<dd><p>The name of the file where exceptions are logged. Each entry
contains the date and time, filename, pathname, exception name and
data, and the HTML error message filename (assuming there is one).
Default: <span class="docutils literal">Logs/Errors.csv</span>.</p>
</dd>
<dt><span class="docutils literal">SaveErrorMessages</span>:</dt>
<dd><p>If True, then errors (e.g., uncaught exceptions) will produce an
HTML file with both the user message and debugging information.
Developers/administrators can view these files after the fact, to see
the details of what went wrong. These error messages can take a
surprising amount of space. Default: <span class="docutils literal">True</span> (do save).</p>
</dd>
<dt><span class="docutils literal">ErrorMessagesDir</span>:</dt>
<dd><p>This is the name of the directory where HTML error messages get
stored. The path is interpreted as relative to the working directory
(or WebKit path, if you're not using a working directory), or you
can specify an absolute path.Default: <span class="docutils literal">ErrorMsgs</span>.</p>
</dd>
<dt><span class="docutils literal">EmailErrors</span>:</dt>
<dd><p>If True, error messages are e-mailed out according to the
ErrorEmailServer and ErrorEmailHeaders settings. You must also set
<span class="docutils literal">ErrorEmailServer</span> and <span class="docutils literal">ErrorEmailHeaders</span>. Default: <span class="docutils literal">False</span>
(false/do not email).</p>
</dd>
<dt><span class="docutils literal">EmailErrorReportAsAttachment</span>:</dt>
<dd><p>Set to True to make HTML error reports be emailed as text with an
HTML attachment, or False to make the html the body of the message.
Default: <span class="docutils literal">False</span> (HTML in body).</p>
</dd>
<dt><span class="docutils literal">ErrorEmailServer</span>:</dt>
<dd><p>The SMTP server to use for sending e-mail error messages, and, if
required, the port, username and password, all separated by colons.
For authentication via "SMTP after POP", you can furthermore append the
name of a POP3 server, the port to be used and an <span class="docutils literal">SSL</span> flag.
Default: <span class="docutils literal">'localhost'</span>.</p>
</dd>
<dt><span class="docutils literal">ErrorEmailHeaders</span>:</dt>
<dd><p>The e-mail headers used for e-mailing error messages. Be sure to
configure <span class="docutils literal">"From"</span>, <span class="docutils literal">"To"</span> and <span class="docutils literal"><span class="pre">"Reply-To"</span></span> before turning
<span class="docutils literal">EmailErrors</span> on. Default:</p>
<pre class="literal-block">{
'From': 'webware@mydomain,
'To': ['webware@mydomain'],
'Reply-To': 'webware@mydomain',
'Content-Type': 'text/html',
'Subject': 'Error'
}</pre>
</dd>
<dt><span class="docutils literal">ErrorPage</span>:</dt>
<dd><p>You can use this to set up custom error pages for HTTP errors and any
other exceptions raised in Webware servlets. Set it to the URL of a
custom error page (any Webware servlet) to catch all kinds of exceptions.
If you want to catch only particular errors, you can set it to a dictionary
mapping the names of the corresponding exception classes to the URL to
which these exceptions should be redirected. For instance:</p>
<pre class="literal-block">{
'HTTPNotFound': '/Errors/NotFound',
'CustomError': '/Errors/Custom'
}</pre>
<p>If you want to catch any exceptions except HTTP errors, you can set it to:</p>
<pre class="literal-block">{
'Exception': '/ErrorPage',
'HTTPException': None
}</pre>
<p>Whenever one of the configured exceptions is thrown in a servlet, you
will be automatically forwarded to the corresponding error page servlet.
More specifically defined exceptions overrule the more generally defined.
You can even forward from one error page to another error page unless
you are not creating loops. In an <span class="docutils literal">HTTPNotFound</span> error page, the servlet
needs to determine the erroneous URI with <span class="docutils literal"><span class="pre">self.request().previousURI()</span></span>,
since the <span class="docutils literal">uri()</span> method returns the URI of the current servlet, which
is the error page itself. When a custom error page is displayed, the
standard error handler will not be called. So if you want to generate
an error email or saved error report, you must do so explicitly in your
error page servlet. Default: <span class="docutils literal">None</span> (no custom error page).</p>
</dd>
<dt><span class="docutils literal">MaxValueLengthInExceptionReport</span>:</dt>
<dd><p>Values in exception reports are truncated to this length, to avoid
excessively long exception reports. Set this to <span class="docutils literal">None</span> if you
don't want any truncation. Default: <span class="docutils literal">500</span>.</p>
</dd>
<dt><span class="docutils literal">RPCExceptionReturn</span>:</dt>
<dd><p>Determines how much detail an RPC servlet will return when an exception
occurs on the server side. Can take the values, in order of increasing
detail, <span class="docutils literal">"occurred"</span>, <span class="docutils literal">"exception"</span> and <span class="docutils literal">"traceback"</span>. The first
reports the string <span class="docutils literal">"unhandled exception</span>", the second prints the actual
exception, and the third prints both the exception and accompanying
traceback. All returns are always strings. Default: <span class="docutils literal">"traceback"</span>.</p>
</dd>
<dt><span class="docutils literal">ReportRPCExceptionsInWebKit</span>:</dt>
<dd><p>True means report exceptions in RPC servlets in the same way as
exceptions in other servlets, i.e. in the logfiles, the error log,
and/or by email. False means don't report the exceptions on the
server side at all; this is useful if your RPC servlets are
raising exceptions by design and you don't want to be notified.
Default: <span class="docutils literal">True</span> (do report exceptions).</p>
</dd>
</dl>
</div>
<div class="section" id="logging">
<h2>Logging</h2>
<dl class="simple">
<dt><span class="docutils literal">LogActivity</span>:</dt>
<dd><p>If True, then the execution of each servlet is logged with useful
information such as time, duration and whether or not an error
occurred. Default: <span class="docutils literal">True</span>.</p>
</dd>
<dt><span class="docutils literal">ActivityLogFilename</span>:</dt>
<dd><p>This is the name of the file that servlet executions are logged to.
This setting has no effect if <span class="docutils literal">LogActivity</span> is False. The path can
be relative to the WebKit location, or an absolute path.
Default: <span class="docutils literal">"Logs/Activity.csv"</span>.</p>
</dd>
<dt><span class="docutils literal">ActivityLogColumns</span>:</dt>
<dd><p>Specifies the columns that will be stored in the activity log.
Each column can refer to an object from the set:
[application, transaction, request, response, servlet, session]
and then refer to its attributes using "dot notation".
The attributes can be methods or instance attributes and can be
qualified arbitrarily deep. Default: <span class="docutils literal">['request.remoteAddress', 'request.method', 'request.uri', 'response.size', 'servlet.name', 'request.timeStamp', 'transaction.duration', 'transaction.errorOccurred']</span>.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="appserver-config">
<h1>AppServer.config</h1>
<dl>
<dt><span class="docutils literal">Host</span>:</dt>
<dd><p>The IP address at which the application server will listen for requests.
Use an empty string (or <span class="docutils literal">0.0.0.0</span>) to listen on all local network
interfaces, or a specific address if you don't want to listen on all of them.
You should consider the security implications of allowing external access.
Default: <span class="docutils literal">localhost</span> (<span class="docutils literal">127.0.0.1</span>).</p>
</dd>
<dt><span class="docutils literal">EnableAdapter</span>:</dt>
<dd><p>Whether the application server should listen for requests from the adapter.
You'll want this on unless you decide to use the built-in HTTP server.
Default: <span class="docutils literal">True</span>.</p>
</dd>
<dt><span class="docutils literal">AdapterPort</span>:</dt>
<dd><p>The port the application server listens to for requests from the adapter.
You cannot point a browser to this port. You may wish to change this if
you have another application running at this port, or if you are running
more than one AppServer, they must each be listening at a different port.
Default: <span class="docutils literal">8086</span>.</p>
</dd>
<dt><span class="docutils literal">EnableMonitor</span>:</dt>
<dd><p>Whether the application server should listen for monitor service requests.
Monitor is a minimal service that accepts a simple protocol and returns a
value indicating the status of the server. If you enable this, a separate
monitoring program such as <span class="docutils literal">Monitor.py</span> can provide additional assurance
that the application server continues running at all times.
Default: <span class="docutils literal">False</span>.</p>
</dd>
<dt><span class="docutils literal">MonitorPort</span>:</dt>
<dd><p>The port for the monitor service. You cannot point a browser to this port.
You may wish to change this if you have another application running at this
port, or if you are running more than one AppServer. Default: <span class="docutils literal">8085</span>.</p>
</dd>
<dt><span class="docutils literal">EnableSCGI</span>:</dt>
<dd><p>Whether the application server should provide an SCGI connector.
This allows you to connect via SCGI instead of using the standard adapter.
Default: <span class="docutils literal">False</span>.</p>
</dd>
<dt><span class="docutils literal">SCGIPort</span>:</dt>
<dd><p>The port the application server listens to for SCGI connections.
You cannot point a browser to this port. You may wish to change this if
you have another application running at this port, or if you are running
more than one AppServer, they must each be listening at a different port.
Default: <span class="docutils literal">8084</span>.</p>
</dd>
<dt><span class="docutils literal">EnableHTTP</span>:</dt>
<dd><p>Whether the built-in HTTP server shall be activated. The server will listen
on the port specified by the <span class="docutils literal">HTTPPort</span> setting. Default: <span class="docutils literal">True</span>.</p>
</dd>
<dt><span class="docutils literal">HTTPPort</span>:</dt>
<dd><p>The port the built-in HTTP server listens on. You can point a web browser
to this port. Default: <span class="docutils literal">8080</span>.</p>
</dd>
<dt><span class="docutils literal">PidFile</span>:</dt>
<dd><p>When the AppServer starts up, the process ID will be written into this file.
The location is relative to the working directory (or WebKit path, if you're
not using a working directory), or you can specify an absolute path.
Default: <span class="docutils literal">appserver.pid</span>.</p>
</dd>
<dt><span class="docutils literal">AddressFiles</span>:</dt>
<dd><p>When the AppServer starts up, the server address (IP address and port)
of the adapter handler and other handlers will be written into files with
this name, <span class="docutils literal">%s</span> being replaced by the name of the respective handler.
The location is relative to the working directory (or WebKit path, if you're
not using a working directory), or you can specify an absolute path.
Default: <span class="docutils literal">%s.address</span>.</p>
</dd>
<dt><span class="docutils literal">PluginDirs</span>:</dt>
<dd><p>When the application server starts up, it looks in these locations for
plugins. Each plugin is a subdirectory of its own. By default WebKit looks
in the <span class="docutils literal">Webware/</span> directory (<span class="docutils literal">..</span>) for plugins -- several of which are
shipped with Webware. Default: <span class="docutils literal"><span class="pre">[".."]</span></span>.
See <a class="reference external" href="Developing.html#creatingplugins">Creating Plugins</a> for information on creating your own plug-ins.</p>
<p>The advantage of a plug-in directory is that you can add new plug-ins to
the app server simply by dropping them into the directory; no additional
configuration is necessary.</p>
</dd>
<dt><span class="docutils literal">PlugIns</span>:</dt>
<dd><p>Loads the plug-ins from the given locations when starting the AppServer.
You must add a directory to the list for every plug-in you use --
<span class="docutils literal">PlugInDirs</span> is usually easier. Default: <span class="docutils literal">[]</span>.</p>
</dd>
<dt><span class="docutils literal">PrintConfigAtStartUp</span>:</dt>
<dd><p>If True, prints configuration to console at startup. Default: <span class="docutils literal">True</span>.</p>
</dd>
<dt><span class="docutils literal">Verbose</span>:</dt>
<dd><p>If True, then additional messages are printed while the AppServer
runs, most notably information about each request such as size and
response time. Default: <span class="docutils literal">True</span>.</p>
</dd>
<dt><span class="docutils literal">SilentURIs</span>:</dt>
<dd><p>If <span class="docutils literal">Verbose</span> is set to True, then you can use this setting to specify
URIs for which you don't want to print any messages in the output of the
AppServer. The value is expected to be a regular expression that is
compared to the request URI. For instance, if you want to suppress output
for images, JavaScript and CSS files, you can set <span class="docutils literal">SilentURIs</span> to
<span class="docutils literal"><span class="pre">'\.(gif|jpg|jpeg|png|js|css)$'</span></span> (though we do not recommend serving
static files with Webware; it's much more efficient to deliver them
directly from the Apache server). If set to <span class="docutils literal">None</span>, messages will be
printed for all requests handled by Webware. Default: <span class="docutils literal">None</span></p>
</dd>
<dt><span class="docutils literal">StartServerThreads</span>:</dt>
<dd><p>The number of threads in the request handler thread pool that will
be created when the application server starts. Default: <span class="docutils literal">10</span>.</p>
</dd>
<dt><span class="docutils literal">MinServerThreads</span>:</dt>
<dd><p>The minimum number of threads in the request handler thread pool.
This makes sure that always some threads are available immediately,
even when there had been no activity for a long time. Default: <span class="docutils literal">5</span>.</p>
</dd>
<dt><span class="docutils literal">MaxServerThreads</span>:</dt>
<dd><p>The maximum number of threads in the request handler thread pool,
and therefore, the maximum number of concurrent requests that can
be served. Unless you have a serious load on a high end machine,
the default is generally sufficient. Default: <span class="docutils literal">20</span>.</p>
</dd>
<dt><span class="docutils literal">UseDaemonThreads</span>:</dt>
<dd><p>If True, make all worker threads daemon threads. This allows the
server to finish even when some of the worker threads cannot be
told to finish their work. Default: <span class="docutils literal">True</span>.</p>
</dd>
<dt><span class="docutils literal">MaxRequestTime</span>:</dt>
<dd><p>This setting controls automatic cancelation of long-running requests.
All worker threads executing requests longer than <span class="docutils literal">MaxRequestTime</span>
seconds will be automatically aborted with a <span class="docutils literal">RequestTooLongError</span>
exception. The monitoring of long-running requests can be disabled
by setting this to <span class="docutils literal">0</span> or <span class="docutils literal">None</span>. Default: <span class="docutils literal">300</span>.</p>
</dd>
<dt><span class="docutils literal">CheckInterval</span>:</dt>
<dd><p>The number of virtual instructions after which Python will check
for thread switches, signal handlers, etc. This is passed directly
to <span class="docutils literal">sys.setcheckinterval()</span>. Benchmarks have shown 100 to give a
worthwhile performance boost with higher values resulting in
little gain. Default: <span class="docutils literal">100</span>.</p>
</dd>
<dt><span class="docutils literal">RequestQueueSize</span>:</dt>
<dd><p>The size of the queue for request handlers that is worked off by the
server threads. A size of zero is interpreted as two times the maximum
number of worker threads, which has proven to be a reasonable number.
Default: <span class="docutils literal">0</span> (<span class="docutils literal">2*MaxServerThreads</span>).</p>
</dd>
<dt><span class="docutils literal">RequestBufferSize</span>:</dt>
<dd><p>Buffer size used for reading incoming socket requests. Default: <span class="docutils literal">8192</span>.</p>
</dd>
<dt><span class="docutils literal">ResponseBufferSize</span>:</dt>
<dd><p>Buffer size for the output response stream. This is only used when a
servlet has set <span class="docutils literal">autoFlush</span> to True using the <span class="docutils literal">flush()</span> method of
the Response. Otherwise, the whole response is buffered and sent in one
shot when the servlet is done. Default: <span class="docutils literal">8192</span>.</p>
</dd>
<dt><span class="docutils literal">AutoReload</span>:</dt>
<dd><p>Enables the AutoReloadingAppServer module. This module is designed
to notice changes to source files, including servlets, PSP's templates,
or changes to the Webware source files, and reload the server as
necessary to pick up the changes.</p>
<p>This uses the FAM (File Alteration Monitor) module specified in the setting
<span class="docutils literal">UseFAMModules</span> if available. You can also specify several modules to
check them in the given order (the default is <span class="docutils literal">gamin _fam</span> for using
<a class="reference external" href="http://www.gnome.org/~veillard/gamin/">python-gamin</a> or <a class="reference external" href="http://python-fam.sourceforge.net">python-fam</a>). Otherwise, if no FAM module is specified
or installed, or when ImportSpy has been disabled by setting <span class="docutils literal">UseImportSpy</span>
to False, it resorts to polling. The polling interval in seconds can be set
with the <span class="docutils literal">AutoReloadPollInterval</span> setting which defaults to 1 second.</p>
<p>By default, <span class="docutils literal">AutoReload</span> is set to <span class="docutils literal">False</span>.</p>
</dd>
</dl>
</div>
</div>
</body>
</html>