source: etc/turl.tcl @ 1

Last change on this file since 1 was 1, checked in by mek, 8 years ago

initial import

File size: 12.5 KB
Line 
1### Turl Sample Configuration file
2### Replace SERVER, and PASSWORD
3set httpport               80
4set httpsport              443
5
6# The hostname and address should be set to actual values.
7set hostname               [ns_info hostname]
8set address                [ns_info address]
9
10set servername             "SERVER"
11set server                 ${servername}
12set serverdesc             "A T Url Server"
13
14set homedir                [file dirname [ns_info config]]
15set bindir                 [file dirname [ns_info nsd]]
16
17set pageroot               /web/${servername}/www
18set directoryfile          index.adp,index.html,index.htm
19
20set user                   "nsadmin"
21set stat_pw                "PASSSWORD"
22
23# nsssl: Only loads if keyfile.pem and certfile.pem exist.
24#set sslmodule              nsssl.so  ;# Domestic 128-bit/1024-bit SSL.
25#set sslmodule              nsssle.so ;# Exportable 40-bit/512-bit SSL.
26#set sslkeyfile   ${homedir}/servers/${servername}/modules/nsssl/keyfile.pem
27#set sslcertfile  ${homedir}/servers/${servername}/modules/nsssl/certfile.pem
28
29#
30# Global server parameters
31#
32ns_section "ns/parameters"
33ns_param    home                    $homedir
34ns_param    debug                   false
35ns_param    ServerLog               "/web/${server}/log/${server}-error.log"
36ns_param    logroll                 true
37ns_param    logexpanded             false                                       
38ns_param    debug                   true                                       
39ns_param    dev                     true                                       
40ns_param    notice                  true                                       
41ns_param    logmaxbackup            30
42#ns_param HackContentType false       ;# automatic adjustment of response
43                                       # content-type header to include charset
44                                       # This defaults to True.
45ns_param  OutputCharset  iso8859-1    ;# Default output charset.  When none specified,
46                                       # no character encoding of output is performed.
47ns_param  URLCharset     iso8859-1    ;# Default Charset for Url Encode/Decode.
48                                       # When none specified, no character set encoding
49                                       # is performed.
50#ns_param  PreferredCharsets { utf-8 iso8859-1 } ;# This parameter supports output
51                                       # encoding arbitration.
52
53#
54# MIME types.
55#
56#  Note: AOLserver already has an exhaustive list of MIME types, but in
57#  case something is missing you can add it here.
58#
59ns_section "ns/mimetypes"
60ns_param   default         "*/*"     ;# MIME type for unknown extension.
61ns_param   noextension     "*/*"     ;# MIME type for missing extension.
62#ns_param   ".xls"          "application/vnd.ms-excel"
63
64#
65#   I18N Mime-types; define content-type header values
66#                    to be mapped from these file-types.
67#                    Note that you can map file-types of adp files to control
68#                    the output encoding through mime-type specificaion.
69#                    Remember to add an adp mapping for that extension.
70#
71ns_param   .adp            "text/html; charset=iso-8859-1"
72ns_param   .u_adp          "text/html; charset=UTF-8"
73ns_param   .gb_adp         "text/html; charset=GB2312"
74ns_param   .sjis_html      "text/html; charset=shift_jis"
75ns_param   .sjis_adp       "text/html; charset=shift_jis"
76ns_param   .gb_html        "text/html; charset=GB2312"
77
78
79#
80#   I18N File-type to Encoding mappings
81#
82ns_section "ns/encodings"
83ns_param   .utf_html       "utf-8"
84ns_param   .sjis_html      "shiftjis"
85ns_param   .gb_html        "gb2312"
86ns_param   .big5_html      "big5"
87ns_param   .euc-cn_html    "euc-cn"
88#
89# Note: you will need to include file-type to encoding mappings
90#       for ANY source files that are to be used, to allow the
91#       server to handle them properly.  E.g., the following
92#       asserts that the GB-producing .adp files are themselves
93#       encoded in GB2312 (this is not simply assumed).
94#
95ns_param   .gb_adp         "gb2312"
96
97
98#
99# Thread library (nsthread) parameters
100#
101ns_section "ns/threads"
102#ns_param   stacksize [expr 128*1024] ;# Per-thread stack size.
103
104
105############################################################
106#
107# Server-level configuration
108#
109#  There is only one server in AOLserver, but this is helpful when multiple
110#  servers share the same configuration file.  This file assumes that only
111#  one server is in use so it is set at the top in the "server" Tcl variable.
112#  Other host-specific values are set up above as Tcl variables, too.
113#
114
115ns_section "ns/servers"
116ns_param   $servername     $serverdesc
117
118
119#
120# Server parameters
121#
122ns_section "ns/server/${servername}"
123ns_param   directoryfile   $directoryfile
124ns_param   pageroot        $pageroot
125ns_param   enabletclpages  true ;# Parse *.tcl files in pageroot.
126#
127#         Server-level I18N Parameters can be specified here, to override
128#         the global ones for this server.  These are:
129#              HackContentType
130#              OutputCharset
131#              URLCharset
132#         See the global parameter I18N section for a description of these.
133#
134
135#
136# Scaling and Tuning Options
137#
138#  Note: These values aren't necessarily the defaults.
139#
140ns_param   connsperthread  0         ;# Normally there's one conn per thread
141ns_param   flushcontent    false     ;# Flush all data before returning
142ns_param   maxconnections  100       ;# Max connections to put on queue
143ns_param   maxdropped      0         ;# Shut down if dropping too many conns
144ns_param   maxthreads      20        ;# Tune this to scale your server
145ns_param   minthreads      0         ;# Tune this to scale your server
146ns_param   threadtimeout   120       ;# Idle threads die at this rate
147
148ns_section "ns/server/${server}/tcl"
149ns_param autoclose       true           ;# Close files the Tcl interp opened
150ns_param debug           true           ;# Names of files sourced is logged
151ns_param nsvbuckets      8              ;# No. of buckets to hold nsv's
152ns_param statlevel       0              ;# How many levels deep to run tclstats
153ns_param statmaxbuf      100            ;# Maximum entries in tclstats table
154ns_param library         "/web/${server}/tcl"
155
156#
157# ADP (AOLserver Dynamic Page) configuration
158#
159ns_section "ns/server/${servername}/adp"
160ns_param   map             "/*.adp"  ;# Extensions to parse as ADP's.
161#   I18N Note: will need to define I18N specifying mappings of ADP's here as well.
162ns_param   map             "/*.html"
163ns_param   map             "/*.u_adp"
164ns_param   map             "/*.gb_adp"
165ns_param   map             "/*.sjis_adp"
166#ns_param   map             "/*.html" ;# Any extension can be mapped.
167ns_param   enableexpire    false     ;# Set "Expires: now" on all ADP's.
168ns_param   enabledebug     false     ;# Allow Tclpro debugging with "?debug".
169
170# ADP special pages
171ns_param   errorpage      ${pageroot}/errorpage.adp ;# ADP error page.
172
173ns_section "ns/server/${servername}/redirects"
174ns_param   404 "/notfound.html"      ;# Not Found error page
175ns_param   500 "/servererror.html"   ;# Server Error page
176
177#
178# Socket driver module (HTTP)  -- nssock
179#
180ns_section "ns/server/${servername}/module/nssock"
181ns_param   port            $httpport
182ns_param   hostname        $hostname
183ns_param   address         $address
184
185
186#
187# Socket driver module (HTTPS) -- nsssl
188#
189#  nsssl does not load unless sslkeyfile/sslcertfile exist (above).
190#
191ns_section "ns/server/${servername}/module/nsssl"
192ns_param   port            $httpsport
193ns_param   hostname        $hostname
194ns_param   address         $address
195#ns_param   keyfile         $sslkeyfile
196#ns_param   certfile        $sslcertfile
197
198
199# Fast Path --
200#
201#     Fast path configuration is used to configure options used for serving
202#     static content, and also provides options to automatically display
203#     directory listings.
204#
205# Parameters:
206#                     
207#     cache               Boolean. Enable cache for normal URLs.
208#                         Optional, default is false.
209#     cachemaxsize        Integer. Size of fast path cache.
210#                         Optional, default is 5120000.
211#     cachemaxentry       Integer. Largest file size allowed in cache.
212#                         Optional, default is cachemaxsize / 10.
213#     mmap                Boolean. Use mmap() for cache.
214#                         Optional, default is false.
215#     directoryfile       String. Directory index/default page to
216#                         look for. Optional, default is directoryfile
217#                         parameter set in ns/server/${servername} section.
218#     directorylisting    String. Directory listing style. Optional,
219#                         Can be "fancy" or "simple".
220#     directoryproc       String. Name of Tcl proc to use to display
221#                         directory listings. Optional, default is to use
222#                         _ns_dirlist. You can either specify directoryproc,
223#                         or directoryadp - not both.
224#     directoryadp        String. Name of ADP page to use to display
225#                         directory listings. Optional. You can either
226#                         specify directoryadp or directoryproc - not both.
227#
228# Example:
229#
230#    ns_section "ns/server/${servername}/fastpath"
231#        ns_param directorylisting fancy
232#
233# See also:
234#
235#     /aolserver/nsd/fastpath.c
236#     /aolserver/tcl/fastpath.tcl         
237
238
239#
240# Example:  Control port configuration.
241#
242# To enable:
243
244# 1. Define an address and port to listen on. For security
245#    reasons listening on any port other then 127.0.0.1 is
246#    not recommended.
247#
248# 2. Decided whether or not you wish to enable features such
249#    as password echoing at login time, and command logging.
250#
251# 3. Add a list of authorized users and passwords. The entires
252#    take the following format:
253#
254#    <user>:<encryptedPassword>:
255#
256#    You can use the ns_crypt Tcl command to generate an encrypted
257#    password. The ns_crypt command uses the same algorithm as the
258#    Unix crypt(3) command. You could also use passwords from the
259#    /etc/passwd file.
260#
261#    The first two characters of the password are the salt - they can be
262#    anything since the salt is used to simply introduce disorder into
263#    the encoding algorithm.
264#
265#    ns_crypt <key> <salt>
266#    ns_crypt x t2
267#   
268#    The configuration example below adds the user "nsadmin" with a
269#    password of "x".
270#
271# 4. Make sure the nscp.so module is loaded in the modules section.
272#
273#ns_section "ns/server/${servername}/module/nscp"
274#    ns_param address 127.0.0.1       
275#    ns_param port 9999
276#    ns_param echopassword 1
277#    ns_param cpcmdlogging 1
278#
279#ns_section "ns/server/${servername}/module/nscp/users"
280#    ns_param user "nsadmin:t2GqvvaiIUbF2:"
281#
282#ns_section "ns/server/${servername}/modules"
283#    ns_param nscp ${bindir}/nscp.so
284#
285
286#
287# Access log -- nslog
288#
289ns_section "ns/server/${servername}/module/nslog"
290ns_param   file            "/web/${server}/log/${server}.log"
291ns_param   rolllog         true      ;# Should we roll log?
292ns_param   rollonsignal    true      ;# Roll log on SIGHUP.
293ns_param   rollhour        0         ;# Time to roll log.
294ns_param   maxbackup       30         ;# Max number to keep around when rolling.
295
296
297#
298# CGI interface -- nscgi
299#
300#  WARNING: These directories must not live under pageroot.
301#
302ns_section "ns/server/${servername}/module/nscgi"
303#ns_param   map "GET  /cgi /usr/local/cgi"     ;# CGI script file dir (GET).
304#ns_param   map "POST /cgi /usr/local/cgi"     ;# CGI script file dir (POST).
305
306
307#
308# Modules to load
309#
310
311ns_section "ns/server/${servername}/modules"
312    ns_param nssock ${bindir}/nssock.so
313    ns_param nslog ${bindir}/nslog.so
314    ns_param nsdb  ${bindir}/nsdb.so
315    #ns_param nscgi ${bindir}/nscgi.so
316    #ns_param nsperm ${bindir}/nsperm.so
317
318ns_section "ns/db/drivers"
319    ns_param   postgres     nspostgres.so
320
321ns_section "ns/db/pools"
322    ns_param   main       "T Url Main Pool"
323
324ns_section "ns/db/pool/main"
325    ns_param Driver postgres
326    ns_param Connections 50
327    ns_param DataSource localhost::${server}
328    ns_param User ${user}
329    ns_param Password ""
330    ns_param Verbose Off
331    ns_param LogSQLErrors On
332    ns_param ExtendedTableInfo On
333    #ns_param MaxOpen 1000000000
334    #ns_param MaxIdle 1000000000
335
336ns_section "ns/server/${server}/db"
337        ns_param Pools          "*"
338        ns_param DefaultPool    "main"
339
340
341#
342# nsssl: Only loads if sslcertfile and sslkeyfile exist (see above).
343#
344if { [file exists $sslcertfile] && [file exists $sslkeyfile] } {
345    ns_param nsssl ${bindir}/${sslmodule}
346} else {
347    ns_log warning "config.tcl: nsssl not loaded -- key/cert files do not exist."
348}
349
350ns_section ns/server/stats
351    ns_param enabled 1
352    ns_param url /stats
353    ns_param user ${user}
354    ns_param password ${stat_pw}
355#
Note: See TracBrowser for help on using the repository browser.