[AOLSERVER] ns_db is not working

2007-05-03 Thread Thorpe Mayes
I have recently installed aolserver 4.5.

Everything seems to be working, except I get this error when I try to use
the ns_db command:

error: Tcl exception:
invalid command name ns_db
while executing
ns_db gethandle $pool
invoked from within
set db [ns_db gethandle $pool]

ns_info works fine.

I know I am missing the obvious.

Thorpe


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] ns_db is not working

2007-05-03 Thread Rusty Brooks
We'll need more information, most notably your config file.  Make sure 
to redact any passwords, hostnames, etc.  My guess is that you're either 
not loading the database driver, or not configuring the ns_db section 
properly.


Rusty

Thorpe Mayes wrote:

I have recently installed aolserver 4.5.

Everything seems to be working, except I get this error when I try to use
the ns_db command:

error: Tcl exception:
invalid command name ns_db
while executing
ns_db gethandle $pool
invoked from within
set db [ns_db gethandle $pool]

ns_info works fine.

I know I am missing the obvious.

Thorpe


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.



--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] ns_db is not working

2007-05-03 Thread Nathan Folkman

Make sure you are loading the nsdb.so module.

Example:

ns_section ns/server/server1/modules
   ns_param nsdb nsdb.so

Hope that helps!

- n

On 5/3/07, Thorpe Mayes [EMAIL PROTECTED] wrote:


I have recently installed aolserver 4.5.

Everything seems to be working, except I get this error when I try to use
the ns_db command:

error: Tcl exception:
invalid command name ns_db
while executing
ns_db gethandle $pool
invoked from within
set db [ns_db gethandle $pool]

ns_info works fine.

I know I am missing the obvious.

Thorpe


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to 
[EMAIL PROTECTED] with the
body of SIGNOFF AOLSERVER in the email message. You can leave the
Subject: field of your email blank.





--
Nathan Folkman
[EMAIL PROTECTED]


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] ns_db is not working

2007-05-03 Thread patrick o'leary




Hey Thorpe

is nsdb loaded in your nsd config file, along with the db actual driver
?
And are the driver dependencies on your LD_LIBRARY_PATH?
If your using mysql check to make sure the library path is right, some
versions of mysql keep
the libs in mysql/lib/mysql, which I usually screw up.


Your config should have something similar to 
~~
ns_section "ns/server/servername/modules"
  ns_param nsdb   ${bindir}/nsdb${shlibext}

ns_section "ns/db/drivers"
   ns_param mysql    nsmysql.so

ns_section "ns/db/pools"
   ns_param mysqldb  "The MySQL Database Pool"

ns_section "ns/db/pool/mysqldb"
   ns_param driver   mysql
   ns_param connections  2
   ns_param user "xx"
   ns_param password 
   ns_param datasource   localhost:3306:somedatabase
   ns_param verbose  on

ns_section "ns/server/servername/db"
   ns_param DefaultPool  mysqldb
   ns_param Pools    *

~~

P

Thorpe Mayes wrote:

  I have recently installed aolserver 4.5.

Everything seems to be working, except I get this error when I try to use
the ns_db command:

error: Tcl exception:
invalid command name "ns_db"
while executing
"ns_db gethandle $pool"
invoked from within
"set db [ns_db gethandle $pool]"

ns_info works fine.

I know I am missing the obvious.

Thorpe


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.

  


-- 
Patrick O'Leary

AOL Syndication Technologies
Phone: + 1 703 265 8763

Honesty is the best policy, but insanity is a better defense !

View
Patrick O Leary's profile





--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.



Re: [AOLSERVER] ns_db is not working

2007-05-03 Thread Dossy Shiobara
On 2007.05.03, Nathan Folkman [EMAIL PROTECTED] wrote:
 Make sure you are loading the nsdb.so module.
 
 Example:
 
 ns_section ns/server/server1/modules
ns_param nsdb nsdb.so
 
 Hope that helps!

It might be useful for us to include a stub ns_db Tcl proc that looks
like:

proc ns_db args {
error nsdb.so is not loaded
}

The proc would naturally get replaced by the real ns_db when the nsdb.so
module is loaded.

It might alleviate this FAQ.

-- Dossy

-- 
Dossy Shiobara  | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on. (p. 70)


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] ns_db is not working

2007-05-03 Thread Dossy Shiobara
On 2007.05.03, Thorpe Mayes [EMAIL PROTECTED] wrote:
 I have recently installed aolserver 4.5.
 
 Everything seems to be working, except I get this error when I try to use
 the ns_db command:
...
 I know I am missing the obvious.

Did you load nsdb.so in the modules section?

-- Dossy

-- 
Dossy Shiobara  | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on. (p. 70)


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] ns_db is not working

2007-05-03 Thread Tom Jackson
This only happens if the nsdb module is not loaded, it has nothing to do with 
configuration of your database driver. The ns_db command itself is missing.

Also, I think this is new, but the ns_getcsv command is now part of the nsdb 
module. You get the same error as below if you try to execute that command 
and the nsdb.so module is not loaded.

tom jackson

On Thursday 03 May 2007 10:05, Thorpe Mayes wrote:
 I have recently installed aolserver 4.5.

 Everything seems to be working, except I get this error when I try to use
 the ns_db command:

 error: Tcl exception:
 invalid command name ns_db
 while executing
 ns_db gethandle $pool
 invoked from within
 set db [ns_db gethandle $pool]

 ns_info works fine.

 I know I am missing the obvious.

 Thorpe


 --
 AOLserver - http://www.aolserver.com/

 To Remove yourself from this list, simply send an email to
 [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the
 email message. You can leave the Subject: field of your email blank.


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] ns_db is not working

2007-05-03 Thread Thorpe Mayes

Thanks to all who replied.

I did load the nsdb.so file, and that solved the ns_db issue.

However, I now have a database pool issue when I try to set the 
database handle:


Error: Tcl exception:
no access to pool: tmayes
while executing
ns_db gethandle $pool
invoked from within
set db [ns_db gethandle $pool]

-

The following is my config file. I can see that things have changed 
since Aolserver 3.x, which is the last version I was running. I 
essentially copied the config file I used in the older version of 
Aolserver to use with 4.5. Clearly, things are not as they were.


Thanks for your help.

Thorpe

-

# $Header: /cvsroot/aolserver/aolserver/nsd/Attic/sample-config.tcl,v 
1.2.4.1 2002/09/17 23:52:03 jgdavidson Exp $


#
# sample-config.tcl --  The AOLserver Startup Script
#
#  This is a Tcl script that is sourced when AOLserver starts up.
#  A detailed reference is in doc/config.txt.
#

ns_log notice nsd_72.tcl: starting to read config file for server2 
(.72)...



#
# Set some Tcl variables that are commonly used throughout this file.
#

set httpport   80
set httpsport  8443

# The hostname and address should be set to actual values.
set hostname   ecognote.com ; # was [ns_info hostname]
set address64.58.34.72
set host   www.ecognote.com
set location   http://www.ecognote.com

set servername server2
set serverdesc Server at 72

set homedir/usr/local/aolserver
set bindir /usr/local/aolserver/bin

set pageroot   ${homedir}/servers/${servername}/pages
set directoryfile  
index.tcl,index.adp,index.html,index.htm,index.php


set ext .so

set serverlog  
/usr/local/aolserver/servers/${servername}/server_log/server.log


set mailhost   mail.ecognizant.net
set smtphost   mail.ecognizant.net


#
# Global server parameters
#
ns_section ns/parameters
ns_param   home$homedir
ns_param   debug   false

ns_param   serverlog   $serverlog
ns_param   userx
ns_param   logroll on
ns_param   logmaxbackup10
#ns_param   mailhost$the_mailhost  ;# do not set this parameter 
- it causes the server to die



#
# Thread library (nsthread) parameters
#
ns_section ns/threads
ns_param   mutexmeter  true  ;# measure lock contention
ns_param   stacksize [expr 256*1024] ;# Per-thread stack size.



#
# Thread library (nsthread) parameters
#
ns_section ns/threads
ns_param   mutexmeter  true  ;# measure lock contention
ns_param   stacksize [expr 256*1024] ;# Per-thread stack size.

#
# 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 */* ;# MIME type for unknown extension.
ns_param   noextension */* ;# MIME type for missing extension.
ns_param   .xls  application/vnd.ms-excel
ns_param   .qtl  application/x-quicktimeplayer



#
# 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

#
ns_section ns/server/${servername}
ns_param   directoryfile   $directoryfile
ns_param   pageroot$pageroot
ns_param   globalstats true  ;# Enable built-in statistics.
ns_param   urlstatstrue  ;# Enable URL statistics.
ns_param   maxurlstats 1000  ;# Max number of URL's to do stats 
on.


#
# Scaling and Tuning Options
#
#  Note: These values aren't necessarily the defaults.
#
ns_param   connsperthread  1 ;# Normally there's one conn per 
thread

#ns_param   flushcontentfalse ;# Flush all data before returning
ns_param   maxconnections  100   ;# Max connections to put on queue
#ns_param   maxdropped  0 ;# Shut down if dropping too many 
conns

ns_param   maxthreads  100;# Tune this to scale your server
ns_param   minthreads  0 ;# Tune this to scale your server
ns_param   socktimeout 30
ns_param   threadtimeout   120   ;# Idle threads die at this rate
ns_param   maxkeepalive100



# Directory listings -- use an ADP or a Tcl proc to generate them.
#ns_param   directoryadp$pageroot/dirlist.adp ;# Choose one or the 
other.

ns_param   directoryproc   _ns_dirlist   ;#  ...but not both!
ns_param   directorylisting simple   ;# Can be simple or 
fancy.


# miscellaneous
ns_param   enabletclpages  true ;# Parse *.tcl files in pageroot.
ns_param   enableaolpress  false

#
# 

Re: [AOLSERVER] ns_db is not working

2007-05-03 Thread Dossy Shiobara
On 2007.05.03, Thorpe Mayes [EMAIL PROTECTED] wrote:
 However, I now have a database pool issue when I try to set the 
 database handle:
 
 Error: Tcl exception:
 no access to pool: tmayes
 while executing
 ns_db gethandle $pool
 invoked from within
 set db [ns_db gethandle $pool]

Your config file looks correct but I'm guessing the connection
information in the pool definition is wrong.

Can you connect using psql using that connect information?

Check the AOLserver server.log ... are you seeing any errors when you
first attempt to use the DB pool?

-- Dossy

-- 
Dossy Shiobara  | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on. (p. 70)


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] ns_db is not working

2007-05-03 Thread Tom Jackson
Here is an example of a multi-server startup, including a printout of the 
effective configuration file (at the top):

http://rmadilo.com/m2/multi-server-example/sample-startup.txt

tom jackson

On Thursday 03 May 2007 11:29, Thorpe Mayes wrote:
 Thanks to all who replied.

 I did load the nsdb.so file, and that solved the ns_db issue.

 However, I now have a database pool issue when I try to set the
 database handle:

 Error: Tcl exception:
 no access to pool: tmayes
  while executing
 ns_db gethandle $pool
  invoked from within
 set db [ns_db gethandle $pool]

 -

 The following is my config file. I can see that things have changed
 since Aolserver 3.x, which is the last version I was running. I
 essentially copied the config file I used in the older version of
 Aolserver to use with 4.5. Clearly, things are not as they were.

 Thanks for your help.

 Thorpe

 -

 # $Header: /cvsroot/aolserver/aolserver/nsd/Attic/sample-config.tcl,v
 1.2.4.1 2002/09/17 23:52:03 jgdavidson Exp $

 #
 # sample-config.tcl --  The AOLserver Startup Script
 #
 #  This is a Tcl script that is sourced when AOLserver starts up.
 #  A detailed reference is in doc/config.txt.
 #

 ns_log notice nsd_72.tcl: starting to read config file for server2
 (.72)...


 #
 # Set some Tcl variables that are commonly used throughout this file.
 #

 set httpport   80
 set httpsport  8443

 # The hostname and address should be set to actual values.
 set hostname   ecognote.com ; # was [ns_info hostname]
 set address64.58.34.72
 set host   www.ecognote.com
 set location   http://www.ecognote.com

 set servername server2
 set serverdesc Server at 72

 set homedir/usr/local/aolserver
 set bindir /usr/local/aolserver/bin

 set pageroot   ${homedir}/servers/${servername}/pages
 set directoryfile
 index.tcl,index.adp,index.html,index.htm,index.php

 set ext .so

 set serverlog
 /usr/local/aolserver/servers/${servername}/server_log/server.log

 set mailhost   mail.ecognizant.net
 set smtphost   mail.ecognizant.net


 #
 # Global server parameters
 #
 ns_section ns/parameters
 ns_param   home$homedir
 ns_param   debug   false

 ns_param   serverlog   $serverlog
 ns_param   userx
 ns_param   logroll on
 ns_param   logmaxbackup10
 #ns_param   mailhost$the_mailhost  ;# do not set this parameter
 - it causes the server to die


 #
 # Thread library (nsthread) parameters
 #
 ns_section ns/threads
 ns_param   mutexmeter  true  ;# measure lock contention
 ns_param   stacksize [expr 256*1024] ;# Per-thread stack size.



 #
 # Thread library (nsthread) parameters
 #
 ns_section ns/threads
 ns_param   mutexmeter  true  ;# measure lock contention
 ns_param   stacksize [expr 256*1024] ;# Per-thread stack size.

 #
 # 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 */* ;# MIME type for unknown extension.
 ns_param   noextension */* ;# MIME type for missing extension.
 ns_param   .xls  application/vnd.ms-excel
 ns_param   .qtl  application/x-quicktimeplayer


 
 #
 # 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

 #
 ns_section ns/server/${servername}
 ns_param   directoryfile   $directoryfile
 ns_param   pageroot$pageroot
 ns_param   globalstats true  ;# Enable built-in statistics.
 ns_param   urlstatstrue  ;# Enable URL statistics.
 ns_param   maxurlstats 1000  ;# Max number of URL's to do stats
 on.

 #
 # Scaling and Tuning Options
 #
 #  Note: These values aren't necessarily the defaults.
 #
 ns_param   connsperthread  1 ;# Normally there's one conn per
 thread
 #ns_param   flushcontentfalse ;# Flush all data before returning
 ns_param   maxconnections  100   ;# Max connections to put on queue
 #ns_param   maxdropped  0 ;# Shut down if dropping too many
 conns
 ns_param   maxthreads  100;# Tune this to scale your server
 ns_param   minthreads  0 ;# Tune this to scale your server
 ns_param   socktimeout 30
 ns_param   threadtimeout   120   ;# Idle threads die at this rate
 ns_param   maxkeepalive100



 # Directory listings -- use an ADP or a Tcl proc to generate them.
 #ns_param   directoryadp