Forum OpenACS Q&A: Getting nsoracle.dll to work in windows 2000
I'm a longtime user of AOLServer. Recently due to circumstances beyond my control, we have to use it under windows. I'm using the very nice precompiled version from empoweringminds (thanks for that!)
It works fine, and starts up without problems, using a very slightly modified version of the same startup file that works under linux (mostly changing some paths and changing so to dll, etc).
The oracle driver does not get loaded and as such the ns_db command is not available. I am using the exact same syntax that I use in linux. it does not fail it simply does not get loaded or mentioned in the logs.
Help!
Here is my config file:
-----------------------------------------------------
########## per nsd.tcl params ########
set sname cog
set host localhost
set port 80
######################################
set home /opt/AOLServer/
set address $host
ns_section "ns/parameters"
ns_param User "nsadmin"
ns_param debug on
ns_param Home $home
ns_param StackSize 200000
ns_param logroll on
ns_param MailHost localhost
ns_param ServerLog $home/servers/${sname}/server.log
ns_section "ns/db/drivers"
ns_param ora8 nsoracle.dll
ns_section "ns/db/pools"
ns_param users users
ns_section "ns/db/pool/users"
ns_param Driver ora8
ns_param Connections 5
ns_param User XXXX
ns_param Password XXXX
ns_param LogSQLErrors on
ns_param Datasource "XXXX"
ns_param ExtendedTableInfo On
ns_section "ns/servers"
ns_param ${sname} "${sname}"
ns_section "ns/server/${sname}"
ns_param globalstats on
ns_param urlstats on
ns_param maxurlstats 1000
ns_param directoryfile "index.html,index.tcl"
ns_param directoryproc Package_Index
ns_param EnableTclPages Off
ns_param ThreadTimeout 600
ns_param MinThreads 1
ns_param MaxConnections 3
ns_param MaxThreads 3
ns_param MaxKeepAlive 3
ns_section "ns/server/${sname}/db"
ns_param Pools *
ns_param defaultpool users
ns_section "ns/server/${sname}/adp"
ns_param Cache off
ns_param map "/*.adp"
ns_param map "/*.html"
ns_param map "/*.htm"
ns_param DefaultParser fancy
ns_section "ns/server/${sname}/adp/parsers"
ns_param fancy ".adp"
#ns_param fancy ".html"
#ns_param fancy ".htm"
#ns_param adp ".adp"
ns_section "ns/server/${sname}/modules"
ns_param nssock nssock.dll
ns_param nslog nslog.dll
ns_param nsperm nsperm.dll
ns_param nscp nscp.dll
ns_section "ns/server/${sname}/module/nslog"
ns_param EnableHostnameLookup Off
ns_param RollFmt %Y-%m-%d
ns_param maxbackup 1000000
ns_schedule_daily 0 0 "ns_logroll"
ns_section "ns/server/${sname}/module/nssock"
ns_param port $port
ns_param hostname $host
ns_param address $address
ns_param location ""
ns_section "ns/server/${sname}/module/nscp"
ns_param port 9999
ns_param address "127.0.0.1"
ns_section "ns/server/${sname}/module/nscp/users"
# The default password for nsadmin is "x". You should change it.
ns_param user "nsd:t2GqvvaiIUbF2:"
#ns_section ns/server/${sname}/redirects
#ns_param 404 /html/file-not-found.tcl
#ns_param 500 /html/server-error.tcl
-------------------------------------------------------
Here is a startup session from the ole logs:
I stop after the main part starts up, when I start getting ns_db errors. There is just more of the same after that.
-------------------------------------------------------
[04/Mar/2004:22:18:52][1776.2004][-main-] Notice: nsmain: AOLserver/4.0 starting
[04/Mar/2004:22:18:52][1776.2004][-main-] Notice: adp[cog]: mapped /*.adp
[04/Mar/2004:22:18:52][1776.2004][-main-] Notice: adp[cog]: mapped /*.html
[04/Mar/2004:22:18:52][1776.2004][-main-] Notice: adp[cog]: mapped /*.htm
[04/Mar/2004:22:18:52][1776.2004][-main-] Notice: modload: loading 'c:/opt/aolserver/bin/nssock.dll'
[04/Mar/2004:22:18:52][1776.2004][-main-] Notice: modload: loading 'c:/opt/aolserver/bin/nslog.dll'
[04/Mar/2004:22:18:52][1776.2004][-main-] Notice: nslog: opened 'c:/opt/aolserver/servers/cog/modules/nslog/access.log'
[04/Mar/2004:22:18:52][1776.2004][-main-] Notice: modload: loading 'c:/opt/aolserver/bin/nsperm.dll'
[04/Mar/2004:22:18:52][1776.2004][-main-] Notice: modload: loading 'c:/opt/aolserver/bin/nscp.dll'
[04/Mar/2004:22:18:52][1776.2004][-main-] Notice: nscp: listening on 127.0.0.1:9999
[04/Mar/2004:22:18:52][1776.2004][-main-] Notice: nscp: added user: nsd
[04/Mar/2004:22:18:54][1776.2004][-main-] Notice: conf: [ns/server/cog]enabletclpages = 0
[04/Mar/2004:22:18:54][1776.2004][-main-] Notice: nsmain: AOLserver/4.0 running
[04/Mar/2004:22:18:54][1776.2116][-sched-] Notice: sched: starting
[04/Mar/2004:22:18:54][1776.1748][-socks-] Notice: socks: starting
[04/Mar/2004:22:18:54][1776.2000][-sched:idle0-] Notice: starting
[04/Mar/2004:22:18:54][1776.2004][-main-] Notice: nssock: listening on localhost:80
[04/Mar/2004:22:18:54][1776.800][-driver-] Notice: starting
[04/Mar/2004:22:18:54][1776.800][-driver-] Notice: driver: accepting connections
[04/Mar/2004:22:18:54][1776.2000][-sched:11-] Error: invalid command name "ns_db"
invalid command name "ns_db"
while executing
"ns_db gethandle $pool "
(procedure "DB_Select" line 14)
invoked from within
-------------------------------------------------------
I also, recently due to circumstances beyond my control, have to use it under Windows. Jamie's work has been tremendously helpful, but using Windows hasn't been much fun. Anyway..... make sure nsoracle.dll is in AOLserver's bin directory and that permissions are correct on it.
The pools section of your configuration file is different from mine. Here's mine:
ns_section ns/db/pools ns_param pool1 "Pool 1" ns_param pool2 "Pool 2" ns_param pool3 "Pool 3" ns_section ns/db/pool/pool1 ns_param maxidle 1000000000 ns_param maxopen 1000000000 ns_param connections 5 ns_param verbose $debug ns_param extendedtableinfo true ns_param logsqlerrors $debug if { $database == "oracle" } { ns_param driver ora8 ns_param datasource {} ns_param user $dbname ns_param password $db1password } else { ns_param driver postgres ns_param datasource localhost::${db_name} ns_param user nsadmin ns_param password "" } ns_section ns/db/pool/pool2 ns_param maxidle 1000000000 ns_param maxopen 1000000000 ns_param connections 5 ns_param verbose $debug ns_param extendedtableinfo true ns_param logsqlerrors $debug if { $database == "oracle" } { ns_param driver ora8 ns_param datasource {} ns_param user $dbname ns_param password $db1password } else { ns_param driver postgres ns_param datasource localhost::${db_name} ns_param user nsadmin ns_param password "" } ns_section ns/db/pool/pool3 ns_param maxidle 1000000000 ns_param maxopen 1000000000 ns_param connections 5 ns_param verbose $debug ns_param extendedtableinfo true ns_param logsqlerrors $debug if { $database == "oracle" } { ns_param driver ora8 ns_param datasource {} ns_param user $dbname ns_param password $db1password } else { ns_param driver postgres ns_param datasource localhost::${db_name} ns_param user nsadmin ns_param password "" } ns_section ns/server/${server}/db ns_param pools "*" ns_param defaultpool pool1
Hope this helps.
ns_section "ns/server/${sname}/modules" ns_param nssock nssock.dll ns_param nslog nslog.dll ns_param nsperm nsperm.dll ns_param nscp nscp.dll ns_param nsdb nsdb.dll ^^^^^^^^^^^^^^^^^^^^^^