ns_log notice "openacs-4.tcl: starting to read config file..." # which database do you want? postgres or oracle set database postgres set httpport 80 set httpsport 443 set debug true set verbose false set connections 5 set servername "server1" set serverdesc "server 1" set email "you@yourdomain.com" set db_name $servername set db_host localhost set db_port 5432 # The hostname and address should be set to actual values. set hostname [ns_info hostname] set address [ns_info address] set homedir [file dirname [ns_info config]] set bindir [file dirname [ns_info nsd]] set pageroot /web/${servername}/www set directoryfile index.tcl,index.adp,index.html,index.htm,index.xhtml,index.xht # nsssl: Only loads if keyfile.pem and certfile.pem exist. #set sslmodule nsssl.so ;# Domestic 128-bit/1024-bit SSL. #set sslmodule nsssle.so ;# Exportable 40-bit/512-bit SSL. #set sslkeyfile ${homedir}/servers/${servername}/modules/nsssl/keyfile.pem #set sslcertfile ${homedir}/servers/${servername}/modules/nsssl/certfile.pem # # Global server parameters # ns_section "ns/parameters" ns_param User nsadmin ns_param Group nsadmin ns_param ServerLog /var/log/weblogs/${servername}-error.log ns_param MaxKeepAlive 0 ns_param LogRoll on ns_param LogMaxBackup 5 ns_param home $homedir ns_param debug $debug # # Thread library (nsthread) parameters # ns_section ns/threads ns_param mutexmeter true ;# measure lock contention ns_param SystemScope on ns_param StackSize [expr 128*1024] # # I18N Parameters # #ns_param HackContentType false ;# automatic adjustment of response # content-type header to include charset # This defaults to True. ns_param OutputCharset iso8859-1 ;# Default output charset. When none specified, # no character encoding of output is performed. ns_param URLCharset iso8859-1 ;# Default Charset for Url Encode/Decode. # When none specified, no character set encoding # is performed. #ns_param PreferredCharsets { utf-8 iso8859-1 } ;# This parameter supports output # encoding arbitration. # # MIME types. # # Note: AOLserver already has an exhaustive list of MIME types, but in # case something is missing you can add it here. # ns_section "ns/mimetypes" ns_param default "text/plain" ;# MIME type for unknown extension. ns_param noextension "text/plain" ;# MIME type for missing extension. ns_param ".xls" "application/vnd.ms-excel" # # Tcl Configuration # ns_section ns/server/${servername}/tcl ns_param Library /web/${servername}/tcl ns_param autoclose on ns_param debug $debug # # 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" ############################################################ # # Server-level configuration # # There is only one server in AOLserver, 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 $servername $serverdesc # # Server parameters # ns_section "ns/server/${servername}" ns_param pageroot $pageroot ns_param directoryfile $directoryfile ns_param Webmaster ${email} ns_param NoticeBgColor {"#ffffff"} ns_param enabletclpages true ;# Parse *.tcl files in pageroot. #ns_param NotFoundResponse /global/file-not-found.html #ns_param ServerBusyResponse /global/busy.html #ns_param ServerInternalErrorResponse /global/error.html #ns_param ForbiddenResponse /global/forbidden.html #ns_param UnauthorizedResponse /global/unauthorized.html ns_param maxconnections 100 ;# Max connections to put on queue ns_param maxthreads 20 ;# Tune this to scale your server ns_param minthreads 20 ;# Tune this to scale your server ns_param globalstats false ;# Enable built-in statistics ns_param urlstats false ;# Enable URL statistics ns_param maxurlstats 1000 ;# Max number of URL's to do stats on #ns_param directoryadp $pageroot/dirlist.adp ;# Choose one or the other #ns_param directoryproc _ns_dirlist ;# ...but not both! #ns_param directorylisting fancy ;# Can be simple or fancy #ns_param connsperthread 0 ;# Normally there's one conn per thread #ns_param flushcontent false ;# Flush all data before returning #ns_param maxdropped 0 ;# Shut down if dropping too many conns #ns_param threadtimeout 120 ;# Idle threads die at this rate # # Server-level I18N Parameters can be specified here, to override # the global ones for this server. These are: # HackContentType # OutputCharset # URLCharset # See the global parameter I18N section for a description of these. # # # ADP (AOLserver Dynamic Page) configuration # ns_section "ns/server/${servername}/adp" ns_param map "/*.adp" ;# Extensions to parse as ADP's. # 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" #ns_param map "/*.html" ;# Any extension can be mapped. ns_param enableexpire false ;# Set "Expires: now" on all ADP's. ns_param enabledebug false ;# Allow Tclpro debugging with "?debug". ns_param DefaultParser fancy # ADP special pages #ns_param errorpage ${pageroot}/errorpage.adp ;# ADP error page. # # Socket driver module (HTTP) -- nssock # ns_section "ns/server/${servername}/module/nssock" ns_param timeout 120 ns_param address $address ns_param hostname $hostname ns_param port $httpport # # Socket driver module (HTTPS) -- nsssl # # nsssl does not load unless sslkeyfile/sslcertfile exist (above). # ns_section "ns/server/${servername}/module/nsssl" #ns_param port $httpsport #ns_param hostname $hostname #ns_param address $address #ns_param keyfile $sslkeyfile #ns_param certfile $sslcertfile ns_section "ns/db/drivers" if { $database == "oracle" } { #ns_param ora8 ora8.so } else { ns_param postgres ${bindir}/nspostgres.so ;# Load PostgreSQL driver } # section added for openacs 4.x - no longer needed (Pascal Scheffers) ns_section ns/db/driver/postgres ns_param pgbin /usr/local/bin # Database Pools: This is how AOLserver ``talks'' to the RDBMS. You need three for # OpenACS: main, log, subquery. Make sure to replace ``yourdb'' and ``yourpassword'' # with the actual values for your db name and the password for it. # AOLserver can have different pools connecting to different databases and even different # different database servers. # ns_section ns/db/pools ns_param main "Main Pool" ns_param log "Log Pool" ns_param subquery "Subquery Pool" ns_section ns/db/pool/main ns_param MaxIdle 1000000000 ns_param MaxOpen 1000000000 ns_param Connections $connections ns_param Verbose $verbose ns_param ExtendedTableInfo On ns_param LogSQLErrors Off if { $database == "oracle" } { ns_param Driver ora8 ns_param DataSource {} ns_param User $db_name ns_param Password $db_password } else { ns_param Driver postgres ns_param DataSource ${db_host}:${db_port}:${db_name} ns_param User nsadmin ns_param Password "" } ns_section ns/db/pool/log ns_param MaxIdle 1000000000 ns_param MaxOpen 1000000000 ns_param Connections $connections ns_param Verbose $verbose ns_param ExtendedTableInfo On ns_param LogSQLErrors Off if { $database == "oracle" } { ns_param Driver ora8 ns_param DataSource {} ns_param User $db_name ns_param Password $db_password } else { ns_param Driver postgres ns_param DataSource ${db_host}:${db_port}:${db_name} ns_param User nsadmin ns_param Password "" } ns_section ns/db/pool/subquery ns_param MaxIdle 1000000000 ns_param MaxOpen 1000000000 ns_param Connections $connections ns_param Verbose $verbose ns_param ExtendedTableInfo On ns_param LogSQLErrors Off if { $database == "oracle" } { ns_param Driver ora8 ns_param DataSource {} ns_param User $db_name ns_param Password $db_password } else { ns_param Driver postgres ns_param DataSource ${db_host}:${db_port}:${db_name} ns_param User nsadmin ns_param Password "" } ns_section ns/server/${servername}/db ns_param Pools "*" ns_param DefaultPool main # Fast Path -- # # Fast path configuration is used to configure options used for serving # static content, and also provides options to automatically display # directory listings. # # Parameters: # # cache Boolean. Enable cache for normal URLs. # Optional, default is false. # cachemaxsize Integer. Size of fast path cache. # Optional, default is 5120000. # cachemaxentry Integer. Largest file size allowed in cache. # Optional, default is cachemaxsize / 10. # mmap Boolean. Use mmap() for cache. # Optional, default is false. # directoryfile String. Directory index/default page to # look for. Optional, default is directoryfile # parameter set in ns/server/${servername} section. # directorylisting String. Directory listing style. Optional, # Can be "fancy" or "simple". # directoryproc String. 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. # directoryadp String. Name of ADP page to use to display # directory listings. Optional. You can either # specify directoryadp or directoryproc - not both. # # Example: # # ns_section "ns/server/${servername}/fastpath" # ns_param directorylisting fancy # # See also: # # /aolserver/nsd/fastpath.c # /aolserver/tcl/fastpath.tcl # # Example: Control port configuration. # # To enable: # # 1. Define an address and port to listen on. For security # reasons listening on any port other then 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 entires # take the following format: # # :: # # 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 # 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/${servername}/module/nscp" # ns_param address 127.0.0.1 # ns_param port 9999 # ns_param echopassword 1 # ns_param cpcmdlogging 1 # #ns_section "ns/server/${servername}/module/nscp/users" # ns_param user "nsadmin:t2GqvvaiIUbF2:" # #ns_section "ns/server/${servername}/modules" # ns_param nscp ${bindir}/nscp.so # # # Access log -- nslog # ns_section "ns/server/${servername}/module/nslog" ns_param EnableHostnameLookup false ns_param File /var/log/weblogs/${servername}.log ns_param LogCombined true ns_param LogRefer false ns_param LogUserAgent false ns_param maxbackup 5 ;# Max number to keep around when rolling. ns_param RollDay * ns_param RollFmt %Y-%m-%d-%H:%M ns_param rollhour 0 ;# Time to roll log. ns_param rolllog true ;# Should we roll log? ns_param rollonsignal true ;# Roll log on SIGHUP. ns_param logreqtime true ;# Log the execution time of request # # CGI interface -- nscgi # # WARNING: These directories must not live under pageroot. # ns_section "ns/server/${servername}/module/nscgi" #ns_param map "GET /cgi /usr/local/cgi" ;# CGI script file dir (GET). #ns_param map "POST /cgi /usr/local/cgi" ;# CGI script file dir (POST). # # Modules to load # ns_section "ns/server/${servername}/modules" ns_param nssock ${bindir}/nssock.so ns_param nslog ${bindir}/nslog.so ns_param nsdb ${bindir}/nsdb.so ns_param nssha1 ${bindir}/nssha1.so ns_param nscache ${bindir}/nscache.so ns_param nsrewrite ${bindir}/nsrewrite.so ns_param nsxml ${bindir}/nsxml.so #ns_param nsfts ${bindir}/nsfts.so #ns_param nsopenssl ${bindir}/nsopenssl.so #ns_param nscgi ${bindir}/nscgi.so #ns_param nsperm ${bindir}/nsperm.so # # nsssl: Only loads if sslcertfile and sslkeyfile exist (see above). # #if { [file exists $sslcertfile] && [file exists $sslkeyfile] } { # ns_param nsssl ${bindir}/${sslmodule} #} else { # ns_log warning "config.tcl: nsssl not loaded -- key/cert files do not exist." #} # # 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. # #ns_section ns/modules #ns_section nssock nssock.so # #ns_section ns/module/nssock #ns_param port $httpport #ns_param hostname $hostname #ns_param address $address # #ns_section ns/module/nssock/servers #ns_param server1 $hostname:$httpport # # # 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. # #ns_section ns/server/server1/pools #ns_section slow "Slow requests here." #ns_section fast "Fast requests here." # #ns_section ns/server/server1/pool/slow #ns_param map {POST /slowupload.adp} #ns_param maxconnections 100 ;# Max connections to put on queue #ns_param maxdropped 0 ;# Shut down if dropping too many conns #ns_param maxthreads 20 ;# Tune this to scale your server #ns_param minthreads 0 ;# Tune this to scale your server #ns_param threadtimeout 120 ;# Idle threads die at this rate # #ns_section ns/server/server1/pool/fast #ns_param map {GET /faststuff.adp} #ns_param maxthreads 10 # # # Example: Web based stats interface. # # To enable: # # 1. Configure whether or not stats are enabled. (Optional: default = false) # 2. Configure URL for statistics. (Optional: default = /_stats) # # http://:/_stats # # 3. Configure user. (Optional: default = aolserver) # 4. Configure password. (Optional: default = stats) # # For added security it is recommended that configure your own # URL, user, and password instead of using the default values. # #ns_section ns/server/stats # ns_param enabled 1 # ns_param url /aolserver/stats # ns_param user nsadmin # ns_param password 23dfs!d # ns_log notice "openacs-4.tcl: finished reading config file."