-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample-config.tcl.in
831 lines (662 loc) · 29.2 KB
/
sample-config.tcl.in
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
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
#
# The Initial Developer of the Original Code and related documentation
# is America Online, Inc. Portions created by AOL are Copyright (C) 1999
# America Online, Inc. All Rights Reserved.
#
#
#
# sample-config.tcl -- Example config script.
#
# This script is an naviserver configuration script with
# several example sections. To use:
#
# % cp sample-config.tcl myconfig.tcl
# % vi myconfig.tcl (edit as needed)
# % bin/nsd -f -t myconfig.tcl (test in foreground)
# % bin/nsd -t myconfig.tcl (run in background)
# % gdb bin/nsd
# (gdb) run -f -d -t myconfig.tcl (run in debugger)
#
#
# Set some Tcl variables that are commonly used throughout this file.
#
# Absolute path to the installation directory
set homedir @NAVISERVER@
# Log directories (access log, error log, pidfile)
set logdir ${homedir}/logs
# You might prefer to keep the log-files in /var/log, so you could use
# a line like the following to place the log-files into a directory
# named /var/log/ns. But don't forget to create the directory first.
#set logdir ${homedir}/../var/log/ns
# Name/description of the virtual server
set server "server1"
set serverdesc "Server Name"
# The hostname, address and port for nssock should be set to actual values.
set hostname [ns_info hostname]
#set address [ns_info address]
set address localhost
set port 8080
# Root directory for each virtual server
set serverdir ${homedir}
# Alternatively in case when multiple server share the same
# installation, server can be put into separate directories
#set serverdir ${homedir}/servers/${server}
# Relative directory under serverdir for html/adp files
set pageroot pages
# Absolute path to pages directory
set pagedir $serverdir/$pageroot
########################################################################
# Modules to load
########################################################################
ns_section ns/server/${server}/modules {
ns_param http ${homedir}/bin/nssock
ns_param nslog ${homedir}/bin/nslog
ns_param nscgi ${homedir}/bin/nscgi
ns_param nsperm ${homedir}/bin/nsperm
#ns_param nscp ${homedir}/bin/nscp
ns_param nsproxy ${homedir}/bin/nsproxy
# Tcl modules are loaded here as well, they should be put
# under tcl/ in separate directory each
#ns_param nstk Tcl
}
########################################################################
# Global server parameters
########################################################################
ns_section ns/parameters {
# Home directory for the server, it will be resolved automaticlaly if not specified
ns_param home $homedir
# Output debug log messages in the log
ns_param logdebug false
# Where all shared Tcl modules are located
ns_param tcllibrary ${homedir}/tcl
# Provide name for main server log file
ns_param serverlog ${logdir}/nsd-${server}.log
# Pid file of the server process
ns_param pidfile ${logdir}/nsd-${server}.pid
# Timeout for shutdown to let existing connections and background
# jobs finish. When this time limit is exceeded the server shuts
# down immediately.
ns_param shutdowntimeout 20s
# Min size of the uploaded file to enable progress tracking
ns_param progressminsize 0
# How many jobs to run in any job thread before thread exits, this will allow
# to reclaim thread memory back to the system if memory allocator supports it
ns_param jobsperthread 0
# Timeout for adding Tcl jobs to the job queue.
ns_param jobtimeout 0s ;# default: 5m
# Log ns_job operations longer than this to the system log
ns_param joblogminduration 1s ;# default 1s
# How many jobs to run in any schedule thread before thread exits.
ns_param schedsperthread 0
# Log warnings when scheduled job takes longer than this time period
ns_param schedlogminduration 2s
# Write asynchronously to log files (access log and error log)
ns_param asynlogcwriter true ;# default: false
# Print duractions of long mutex calls to stderr.
ns_param mutexlocktrace true ;# default: false
# Reject output operations on already closed or detached connections
# (e.g. subsequent ns_return statements)
#ns_param rejectalreadyclosedconn false ;# default: true
# Is the server running behind a reverse proxy server? When
# activated, determine the client IP address per default via the
# value provided by the reverse proxy server.
#ns_param reverseproxymode true ;# default: false
#
# I18N Parameters
#
# Default output charset. When none specified, no character encoding of
# output is performed. (default: utf-8)
#ns_param outputcharset utf-8
# Default Charset for Url Encode/Decode. When none specified, no character
# set encoding is performed. (default: utf-8)
#ns_param urlcharset utf-8
# In cases were UTF-8 parsing fails in forms, retry with the specified charset.
# ns_param formfallbackcharset iso8859-1
# This parameter supports output encoding arbitration.
ns_param preferredcharsets { utf-8 iso8859-1 }
#
# Configuration of serverlog
#
# Rolling of logfile:
ns_param logroll on
# ns_param logmaxbackup 100 ;# (default: 10)
# ns_param logrollfmt %Y-%m-%d ;# timestamp format appended to serverlog filename when rolled
#
# Format of log entries in serverlog:
# ns_param logsec false ;# add timestamps in second resolution (default: true)
# ns_param logusec true ;# add timestamps in microsecond (usec) resolution (default: false)
# ns_param logusecdiff true ;# add timestamp diffs since in microsecond (usec) resolution (default: false)
# ns_param logthread false ;# add thread-info the log file lines (default: true)
#
# ns_param logcolorize true ;# colorize log file with ANSI colors (default: false)
# ns_param logprefixcolor green ;# black, red, green, yellow, blue, magenta, cyan, gray, default
# ns_param logprefixintensity normal;# bright or normal
# ns_param sanitizelogfiles 1 ;# default: 2; 0: none, 1: full, 2: human-friendly
#
# Severities to be logged (can also be controlled at runtime via ns_logctl)
# ns_param logdebug false ;# debug messages
# ns_param logdev false ;# development message
# ns_param lognotice true ;# informational messages
#
# DNS configuration parameters
#
ns_param dnscache true ;# default: true
ns_param dnswaittimeout 5s ;# time for waiting for a DNS reply; default: 5s
ns_param dnscachetimeout 1h ;# time to keep entries in cache; default: 1h
ns_param dnscachemaxsize 500kB ;# max size of DNS cache in memory units; default: 500kB
}
########################################################################
# MIME types.
#
# Note: NaviServer already has an exhaustive list of MIME types, but in
# case something is missing you can add it here.
########################################################################
ns_section ns/mimetypes {
# MIME type for unknown extension.
ns_param default "*/*"
# MIME type for missing extension.
ns_param noextension "*/*"
#
# I18N Mime-types
#
# Define content-type header values to be mapped from these file-types.
#
# Note that you can map file-types of adp files to control
# the output encoding through mime-type specificaion.
# Remember to add an adp mapping for that extension.
#
ns_param .adp "text/html; charset=iso-8859-1"
ns_param .u_adp "text/html; charset=UTF-8"
ns_param .gb_adp "text/html; charset=GB2312"
ns_param .sjis_html "text/html; charset=shift_jis"
ns_param .sjis_adp "text/html; charset=shift_jis"
ns_param .gb_html "text/html; charset=GB2312"
}
########################################################################
# I18N File-type to Encoding mappings
########################################################################
ns_section ns/encodings {
ns_param .utf_html "utf-8"
ns_param .sjis_html "shiftjis"
ns_param .gb_html "gb2312"
ns_param .big5_html "big5"
ns_param .euc-cn_html "euc-cn"
#
# Note: you will need to include file-type to encoding mappings
# for ANY source files that are to be used, to allow the
# server to handle them properly. E.g., the following
# asserts that the GB-producing .adp files are themselves
# encoded in GB2312 (this is not simply assumed).
#
ns_param .gb_adp "gb2312"
}
########################################################################
# Provide a mapping from a charset name and tcl mapping
########################################################################
#ns_section ns/charsets {
# ns_param iso-8859-1 iso8859-1
#}
########################################################################
# Thread library (nsthread) parameters
########################################################################
ns_section ns/threads {
# Global thread stacksize configuration deprecated. Server now uses OS
# default. Only explicitly set the stacksize to some smaller than default
# value if you need to save memory because your server has a lot of
# threads, and you know for certain this won't cause problems with deeply
# nested Tcl or ADP scripts.
ns_param stacksize 128kB
}
########################################################################
# Server-level configuration
#
# There is only one server in naviserver, but this is helpful when multiple
# servers share the same configuration file. This file assumes that only
# one server is in use so it is set at the top in the "server" Tcl variable.
# Other host-specific values are set up above as Tcl variables, too.
########################################################################
ns_section ns/servers {
ns_param $server $serverdesc
}
########################################################################
# Server parameters
#
# Server-level I18N Parameters can be specified here, to override
# the global ones for this server.
# These are: outputcharset urlcharset formfallbackcharset
# See the global parameter I18N section for a description of these.
########################################################################
ns_section ns/server/${server} {
#
# Scaling and Tuning Options
#
# Maximum number of connection structures
ns_param maxconnections 100 ;# 100; determines queue size as well
ns_param rejectoverrun true ;# false (send 503 when queue overruns)
#ns_param retryafter 5s ;# time for Retry-After in 503 cases
# Use RWLocks instead of mutex locks for filters
ns_param filterrwlocks true
# Minimal and maximal number of connection threads
ns_param maxthreads 10
ns_param minthreads 1
# Connection thread lifetime management
ns_param connsperthread 10000 ;# Number of connections (requests) handled per thread.
;# Setting connsperthread to > 0 will cause the thread to
;# graceously exit, after processing that many
;# requests, thus initiating kind-of Tcl-level
;# garbage collection.
ns_param threadtimeout 2m ;# Timeout for idle threads. In case, minthreads < maxthreads,
;# threads are shutdown after this idle time until
;# minthreads are reached
# Connection thread creation eagerness
#ns_param lowwatermark 10 ;# 10; create additional threads above this queue-full percentage
#ns_param highwatermark 100 ;# 80; allow concurrent creates above this queue-is percentage
;# 100 means to disable concurrent creates
#
# Configuration of replies
#
# ns_param noticedetail false ;# true, return detail information in server reply
# ns_param noticeadp returnnotice.adp ;# ADP file for ns_returnnotice.
# Compress response character data: ns_return, ADP etc.
ns_param compressenable off ;# Default; use ns_conn compress to override
ns_param compresslevel 4 ;# 1-9 where 9 is high compression, high overhead
ns_param compressminsize 512 ;# Compress responses larger than this
# ns_param compresspreinit true ;# false; if true then initialize and allocate buffers at startup
ns_param errorminsize 0 ;# 514, fill-up reply to at least specified bytes (for ?early? MSIE)
# Extra server-specific response header fields
#ns_param extraheaders {Referrer-Policy "strict-origin"}
}
########################################################################
# ADP (AOLserver Dynamic Page) configuration
########################################################################
ns_section ns/server/${server}/adp {
# Extensions to parse as ADP's.
ns_param map "/*.adp"
# Set "Expires: now" on all ADP's.
ns_param enableexpire false
# Allow Tclpro debugging with "?debug".
ns_param enabledebug false
# Parse *.tcl files in pageroot.
ns_param enabletclpages true
# I18N Note: will need to define I18N specifying mappings of ADP's here as well.
ns_param map "/*.u_adp"
ns_param map "/*.gb_adp"
ns_param map "/*.sjis_adp"
# Size of ADP buffer and cache
ns_param bufsize 5MB ;# default: 1MB
ns_param cachesize 10MB ;# default: 5MB
# ADP start page to use for empty ADP requests
#ns_param startpage $pagedir/index.adp
# ADP error page.
#ns_param errorpage $pagedir/errorpage.adp
}
########################################################################
# Server specific Tcl setup
########################################################################
ns_section ns/server/${server}/tcl {
# Number of buckets in Tcl hash table for nsv vars
ns_param nsvbuckets 16
# Use RWLocks instead of mutex locks for nsv vars
ns_param nsvrwlocks true
# Path to private Tcl modules
ns_param library ${homedir}/modules/tcl
# Set to "true" to use Tcl-trace based interp initialization.
ns_param lazyloader false
}
########################################################################
# Fast Path --
#
# Fast path configuration is used to configure options used for serving
# static content, and also provides options to automatically display
# directory listings.
########################################################################
ns_section ns/server/${server}/fastpath {
# Defines absolute or relative path to server's home directory
# (relative to "home", default empty)
ns_param serverdir ${serverdir}
# Defines absolute or relative to serverdir directory where all
# html/adp pages are located (relative to "serverdir", default "pages").
ns_param pagedir ${pageroot}
# Directory index/default page to look for.
ns_param directoryfile "index.adp index.tcl index.html index.htm"
# If the requested URL points to a directory, and no
# "directoryfile" was found in this directory, invoke a directory
# listing ADP by configuring "directoryadp", or invoke the Tcl
# proc specified by "directoryproc".
#
# Name of ADP page to use to display directory listings. Optional. You can either
# specify directoryadp or directoryproc - not both.
#ns_param directoryadp ""
# Name of Tcl proc to use to display directory listings. Optional, default is to use
# _ns_dirlist. You can either specify directoryproc, or directoryadp - not both.
ns_param directoryproc _ns_dirlist
# Directory listing style. Optional, can be "fancy", or "simple",
# or "none", defaults to "simple". This value is a parameter for
# the directoryproc "_ns_dirlist".
ns_param directorylisting fancy
# Hide files starting with a dot in directory listings (boolean, defaults to false).
# This value is a parameter for the directoryproc "_ns_dirlist".
ns_param hidedotfiles true
}
########################################################################
# Global FastPath settings
########################################################################
ns_section ns/fastpath {
# Enable cache for normal URLs. Optional, default is false.
ns_param cache false
# Size of fast path cache. Optional, default is 10MB.
ns_param cachemaxsize 10MB
# Largest file size allowed in cache. Optional, default is 8kB
ns_param cachemaxentry 8kB
# Use mmap() for cache. Optional, default is false.
ns_param mmap false
# Return gzip-ed variant, if available and allowed by client (default false)
#ns_param gzip_static true
# Refresh stale .gz files on the fly using ::ns_gzipfile (default false)
#ns_param gzip_refresh true
# Return the specified command for re-compressing when gzip file is outdated
#ns_param gzip_cmd "/usr/bin/gzip -9"
# When recompressing outdated gzip files, do also minify css or js when
# these cmds are specified. The configured commands must be able to
# read from stdin and to write to stdout.
#
#ns_param minify_css_cmd "/usr/bin/yui-compressor --type css"
#ns_param minify_js_cmd "/usr/bin/yui-compressor --type js"
}
########################################################################
# Socket driver module nssock for HTTP connections
########################################################################
ns_section ns/server/${server}/module/http {
# TCP port server will listen on
ns_param port $port
# Space separated list of IP addresses (listen addresses)
ns_param address $address
# Hostname to use in redirects
ns_param hostname $hostname
# Max upload size
ns_param maxinput 10MB
# Max line size
ns_param maxline 8192
# Read-ahead buffer size
ns_param bufsize 16kB
# Max upload size when to use spooler
ns_param readahead 16kB
# Number of requests to accept at once
ns_param acceptsize 1
# Max number of sockets in the driver queue
ns_param maxqueuesize 256
# Performance optimization, may cause recvwait to be ignored if no data sent (default false)
ns_param deferaccept false
# Spooling Threads
#ns_param spoolerthreads 1 ;# 0, number of upload spooler threads
#ns_param maxupload 100kB ;# 0, when specified, spool uploads larger than this value to a temp file
#ns_param writerthreads 1 ;# 0, number of writer threads
#ns_param writersize 1kB ;# 1MB, use writer threads for files larger than this value
#ns_param writerbufsize 16kB ;# 8kB, buffer (chunk) size for writer threads
#ns_param writerstreaming true ;# false; activate writer for streaming HTML output (e.g. ns_writer)
#ns_param driverthreads 2 ;# 1, number of driver threads (requires support of SO_REUSEPORT)
# Tuning of parameters for persistent connections
ns_param keepwait 5s ;# timeout for keep-alive
ns_param keepalivemaxuploadsize 500kB ;# don't allow keep-alive for upload content larger than this
ns_param keepalivemaxdownloadsize 1MB ;# don't allow keep-alive for download content larger than this
# Extra driver-specific response header fields
#ns_param extraheaders {X-XSS-Protection "1; mode=block"}
}
########################################################################
# Access log -- nslog
########################################################################
ns_section ns/server/${server}/module/nslog {
# Name to the log file (default: access.log)
ns_param file ${logdir}/access-${server}.log
# If true then use common log format (default: true)
ns_param formattedtime true
# If true then use NCSA combined format (default: true)
ns_param logcombined true
# Put in the log request elapsed time (default: false)
ns_param logreqtime false
# Include high-res start time and partial request durations (accept, queue, filter, run; default: false)
ns_param logpartialtimes false
# Include thread name as second token in the log entries (default: false)
ns_param logthreadname false
# Max # of lines in the buffer, 0 == no limit (default: 0)
ns_param maxbuffer 0
# Max # of files to keep when rolling (default: 100)
ns_param maxbackup 100
# Time to roll log (default: 0)
ns_param rollhour 0
# If true then do the log rolling (default: true)
ns_param rolllog true
# If true then roll the log on SIGHUP (default: false)
ns_param rollonsignal false
# If true then don't show query string in the log (default: false)
ns_param suppressquery false
# If true ten check for X-Forwarded-For header (default: false)
ns_param checkforproxy false
# List of additional headers to put in the log
#ns_param extendedheaders "Referer X-Forwarded-For"
# Mask IP address in log file for GDPR (like anonip IP anonymizer; default: false)
ns_param masklogaddr true
ns_param maskipv4 255.255.255.0 ;# mask for IPv4 addresses
ns_param maskipv6 ff:ff:ff:ff:: ;# mask for IPv6 addresses
}
########################################################################
# CGI interface -- nscgi
#
# WARNING: These directories must not live under pageroot.
########################################################################
ns_section ns/server/${server}/module/nscgi {
# CGI script file dir (GET).
ns_param map "GET /cgi-bin /usr/local/cgi"
# CGI script file dir (POST).
ns_param map "POST /cgi-bin /usr/local/cgi"
# Allow to serve static resources from cgi directories
#ns_param allowstaticresources true ;# default false;
# Definition of script file interpreters
ns_param interps CGIinterps
}
#
# Define which Perl should be used for files with the ".pl" extension
# in the cgi-bin directory. Same for shell scripts with extension
# ".sh".
#
ns_section ns/interps/CGIinterps {
ns_param .pl "/opt/local/bin/perl"
ns_param .sh "/bin/bash"
}
########################################################################
# Example: Control port configuration.
#
# To enable:
#
# 1. Define an address and port to listen on. For security
# reasons listening on any port other than 127.0.0.1 is
# not recommended.
#
# 2. Decided whether or not you wish to enable features such
# as password echoing at login time, and command logging.
#
# 3. Add a list of authorized users and passwords. The entries
# take the following format:
#
# <user>:<encryptedPassword>:
#
# You can use the ns_crypt Tcl command to generate an encrypted
# password. The ns_crypt command uses the same algorithm as the
# Unix crypt(3) command. You could also use passwords from the
# /etc/passwd file.
#
# The first two characters of the password are the salt - they can be
# anything since the salt is used to simply introduce disorder into
# the encoding algorithm.
#
# ns_crypt <key> <salt>
# ns_crypt x t2
#
# The configuration example below adds the user "nsadmin" with a
# password of "x".
#
# 4. Make sure the nscp.so module is loaded in the modules section.
########################################################################
ns_section ns/server/${server}/module/nscp {
ns_param address 127.0.0.1
ns_param port 9999
ns_param echopassword true
ns_param cpcmdlogging false
}
ns_section ns/server/${server}/module/nscp/users {
ns_param user "nsadmin:t2GqvvaiIUbF2:"
}
########################################################################
# Example: Host headers based virtual servers.
#
# To enable:
#
# 1. Load comm driver(s) globally.
# 2. Configure drivers as in a virtual server.
# 3. Add a "servers" section to map virtual servers to Host headers.
# 4. Ensure "defaultserver" in comm driver refers to a defined
# virtual server.
#
########################################################################
ns_section ns/module/http {
ns_param port $port
ns_param hostname $hostname
ns_param address $address ;# Space separated list of IP addresses
ns_param defaultserver $server
}
ns_section ns/module/http/servers {
ns_param $server $hostname
}
########################################################################
# Example: Dynamic Host headers based virtual servers.
#
# To enable:
#
# 1. Enable by setting enabled to true.
# 2. For each hosted name create directory under ${serverdir}
# 3. Each virtual host directory should have ${pageroot} subdirectory
#
# /usr/local/ns/
# servers/${server}
# host.com/
# pages
# domain.net/
# pages
#
########################################################################
ns_section ns/server/${server}/vhost {
# Enable or disable virtual hosting
ns_param enabled false
# Prefix between serverdir and hostname
ns_param hostprefix ""
# Remove :port in the Host: header when building pageroot path so Host: www.host.com:80
# will result in pageroot ${serverdir}/www.host.com
ns_param stripport true
# Remove www. prefix from Host: header when building pageroot path so Host: www.host.com
# will result in pageroot ${serverdir}/host.com
ns_param stripwww true
# Hash the leading characters of string into a path, skipping periods and slashes.
# If string contains less characters than levels requested, '_' characters are used as padding.
# For example, given the string 'foo' and the levels 2, 3:
# foo, 2 -> /f/o
# foo, 3 -> /f/o/o
ns_param hosthashlevel 0
}
########################################################################
# Example: Multiple connection thread pools.
#
# To enable:
#
# 1. Define one or more thread pools.
# 2. Configure pools as with the default server pool.
# 3. Map method/URL combinations to the pools
#
# All unmapped method/URL's will go to the default server pool.
#
# The following parameters can be configured per pool:
#
# map
# connectionratelimit
# connsperthread
# highwatermark
# lowwatermark
# maxconnections
# maxthreads
# minthreads
# poolratelimit
# rejectoverrun
# retryafter
# threadtimeout
#
########################################################################
ns_section ns/server/server1/pools {
ns_param slow "Slow requests here."
ns_param fast "Fast requests here."
}
ns_section ns/server/server1/pool/slow {
ns_param map "POST /slowupload.adp"
ns_param maxthreads 20
ns_param minthreads 1
}
ns_section ns/server/server1/pool/fast {
ns_param map "GET /faststuff.adp"
ns_param maxthreads 10
}
########################################################################
# Tcl Proxy module -- nsproxy
#
# Below is the list of all supported configuration options
# for the nsproxy module filled in with their default values.
# This list of default values is also compiled in the code
# in case you omit the ns_param lines.
########################################################################
ns_section ns/server/${server}/module/nsproxy {
# Proxy program to start
ns_param exec ${homedir}/bin/nsproxy
# Timeout when evaluating scripts
ns_param evaltimeout 0s
# Timeout when getting proxy handles
ns_param gettimeout 0s
# Timeout to send data
ns_param sendtimeout 5s
# Timeout to receive results
ns_param recvtimeout 5s
# Timeout to wait for worker processes to die
ns_param waittimeout 1s
# Timeout for a worker process to live idle
ns_param idletimeout 5m
# log eval operations longer than this to the system log
ns_param logminduration 1s
# Max number of allowed worker processes alive
ns_param maxworkers 8
}
########################################################################
# Limits support
#
# Connection limits can be bundled together into a
# named set of limits and then applied to a subset of the URL
# hierarchy. The max number of connection threads running and waiting to
# run a URL, the max upload file size, and the max time a connection
# should wait to run are all configurable.
########################################################################
ns_section ns/limits {
ns_param default "Default Limits"
}
ns_section ns/limit/default {
# Conn threads running for limit.
ns_param maxrun 100
# Conn threads waiting for limit.
ns_param maxwait 100
# Total seconds to wait for resources.
ns_param timeout 60
}
ns_section ns/server/server1/limits {
# Map default limit to URL.
ns_param default "GET /*"
ns_param default "POST /*"
ns_param default "HEAD /*"
}