========================================================================= Date: Wed, 30 Jul 1997 15:57:32 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Dave Zais MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I'm running an external database driver and am running into problems when the database daemons time out after periods of database inactivity. I wanted to know if there was a way to keep them from timing out. I've tried setting the maxIdle and maxOpen parameters both to 0 but they still keep timing out. Any help would be greatly appreciated. I'm using AOLServer 2.1 on solaris. Thanks David Zais dzais@pfn.com ========================================================================= Date: Fri, 1 Aug 1997 13:46:14 +0100 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Barlow Subject: server log fills with garbage Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hi all,On my winNT server I occasionally find that my Virtual server logs will randomly fill with magabytes worth of gibberish, it looks like it may be some binary code trying to display as ascii or something, Nothing but unreadable characters! this will take a 256K access log and fill it to 2.5Meg with garbage. I cannot determine what is causing this, or why! after the log gets corrupted I cannot view the log easily to tell if that Virtual server had hung or not causing the error. This has happend probably a dozen times now in the past year. I have the reverse DNS name resolution turned off on all my servers, That fixed the AOlserver lockups I had been haveing anyways! If anyone else has seen this problem, please let me know what is causing it! Sincerely Kerry & Donald Barlow&Barlow computers Servers for you. http://mntnweb.com barlow@servtech.com ========================================================================= Date: Fri, 1 Aug 1997 14:30:56 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Doug McKee In-Reply-To: <01BC9D01.4AD2D330@DZPC> (message from Dave Zais on Wed, 30 Jul 1997 15:57:32 -0400) >>>>> "Dave" == Dave Zais writes: Dave> I'm running an external database driver and am running into Dave> problems when the database daemons time out after periods of Dave> database inactivity. I wanted to know if there was a way to Dave> keep them from timing out. I've tried setting the maxIdle Dave> and maxOpen parameters both to 0 but they still keep timing Dave> out. Any help would be greatly appreciated. I'm using Dave> AOLServer 2.1 on solaris. AOLserver 2.2 fixes both of these problems. First, external database daemons time out correctly, and second, the 0 values for the maxIdle and maxOpen parameters are implemented. Even though it's "beta," you should have a better time with 2.2. doug -- ------------------------------------------------------------------- Doug McKee, Manager, Web Server Development Email: doug@aol.net America Online, Inc. Voice: (703) 918-1333 8619 Westwood Center Drive Fax: (703) 918-2710 Vienna, VA 22182 ------------------------------------------------------------------- ========================================================================= Date: Sat, 2 Aug 1997 17:07:23 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: "Kriston J. Rehberg" Organization: AOL Web Server Development at http://www.aolserver.com/ Subject: AOLserver Web Slideshow of our wedding Hi, If you would like to see some pictures from our wedding, there's a dynamically-generated web slideshow at: kriston.web.aol.com/wedding/pictures/ It's written with AOLserver's built-in TCL interpreter. Please send me comments on the web slide show (about the pictures or even about the program itself!). I add enhancements from time to time. Soon it will have more features (dynamic thumbnail generator, dynamic use of image size for smoother display, client-pull and its cousin server-push for "sit back and relax" slideshows,, and anything else I can think of). But, for now, tell me what you think! For techies, take a look at the clean URL's used to progress through the slide show. There's no CGI used here, so server CPU utilization is very small. (And the date of our wedding is used in the HTTP headers to keep the pages fresh!) Enjoy, Kris Rehberg -- Kriston J. Rehberg http://kriston.web.aol.com/contact/ America Online, Inc. http://members.aol.com/kriston/ Web Server Development http://webdev.web.aol.com/ Vienna, Virginia endeavor to persevere ========================================================================= Date: Mon, 4 Aug 1997 17:53:40 -0700 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Michael Kmiec Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" At 02:30 PM 8/1/97 -0400, you wrote: >>>>>> "Dave" == Dave Zais writes: > > Dave> I'm running an external database driver and am running into > Dave> problems when the database daemons time out after periods of > Dave> database inactivity. I wanted to know if there was a way to > Dave> keep them from timing out. I've tried setting the maxIdle > Dave> and maxOpen parameters both to 0 but they still keep timing > Dave> out. Any help would be greatly appreciated. I'm using > Dave> AOLServer 2.1 on solaris. > >AOLserver 2.2 fixes both of these problems. First, external database >daemons time out correctly, and second, the 0 values for the maxIdle >and maxOpen parameters are implemented. Even though it's "beta," you >should have a better time with 2.2. > >doug Hi Doug... I'm just back from vacation, and I picked up this thread. I'm working (on and off) with David Zais on this, so my interest is piqued. I tried setting things up with your recomendation. Using AOLServer 2.2b4, I set it up using the same nsd.ini file that David was using to test (relevant sections changed, of course.) The daemons still time out, which of course, is normal. The problem comes when the daemons have to restart and access the database (this is why David wanted to know how to *not* have them time out, so as to avoid the problems encountered when they restart.) This is the behavior I've seen, in as straightforward a manner as I can come up with: 1) The AOLServer starts, goes through its normal wake up. 2) Something is requested from the database (INSERT, SELECT, UPDATE, etc.) thus causing the daemon(s) to initialize/startup and become an active process on the machine (0-to-n, depending on how many specified with the "Connections" parameter in the nsd.ini file and how much db activity is going on.) All is well. 3) The database request is processed through the daemon. Everything is handled properly (SELECTs return info, INSERTs put it in, etc.) 4) After a period of time, the daemon(s) time out and their processes disappear from the machine. This occurs even if MaxIdle and MaxOpen are set to a value of 0. It appears to happen after 10 minutes, which if I remember correctly, is the default for these parameters. (As an aside - are these the correct parameters to alter to get the daemon to *never* time out?) 5) Another request is made from AOLServer to access the database - in any fashion (SELECT, INSERT, etc.) 6) The daemon(s) initialize/startup again. 7) The database request begins its processing, getting as far as AOLServer REC'ing the information from the database (see attached server.log clipping.) This we see in the server.log. 8) After the server receives all the information from the database (and the appropriate "end-of-info" flag,) the following is written to the log (a message we've seen before): [04/Aug/1997:16:47:13 -0400][1444.26][test] Notice: Sock(http://server.pfn.com:8448): write to 10.1.2.21(266) failed: Result too large (code 34) ...this, in turn returns the "Document contains no data" message in Netscape. 9) The log then reports this: [04/Aug/1997:16:47:13 -0400][1444.26][test] Notice: SENT |flush 0 | [04/Aug/1997:16:47:13 -0400][1444.26][test] Notice: REC |ok| ...so it would seem that the daemon has done its job. 10) Repeat steps 4-9. Rinse. Lather. Repeat. To break this cycle, the AOLServer must be shut down and restarted. But this only works for as long as the daemons do not time out. we've tried this with both our code (multiple daemons/requests/accesses to a database) and without (single daemon accessing, with single request - this done with the AOLServer built-in Database Services Administration functions.) Both ways result the same. If you think it would be helpful, I can send you the code for the IUS driver. I meant to send this code earlier (and under far better circumstances) but you know how startup companies can get. Let me know... /mike --- THE FOLLOWING IS A SNIP FROM THE SERVER.LOG, SOME TABLE NAMES HAVE BEEN REMOVED FOR CLARITY --- [04/Aug/1997:16:47:12 -0400][1444.26][test] Notice: REC |ok| [04/Aug/1997:16:47:12 -0400][1444.26][test] Notice: SENT |open 30 default:domainserver#nsadmin##| [04/Aug/1997:16:47:13 -0400][1444.26][test] Notice: REC |ok| [04/Aug/1997:16:47:13 -0400][1444.26][test] Notice: SENT |identify 0 | [04/Aug/1997:16:47:13 -0400][1444.26][test] Notice: REC |Informix Universal Server Proxy Daemon v1.0| [04/Aug/1997:16:47:13 -0400][1444.26][test] Notice: Ns_ExtOpenDb(External): Opened datasource: default:domainserver with Informix Universal Server Proxy Daemon v1.0 [04/Aug/1997:16:47:13 -0400][1444.26][test] Notice: SENT |tablelist 1 0| [04/Aug/1997:16:47:13 -0400][1444.26][test] Notice: REC |ok| [04/Aug/1997:16:47:13 -0400][1444.26][test] Notice: REC |9| [04/Aug/1997:16:47:13 -0400][1444.26][test] Notice: REC |systables| [04/Aug/1997:16:47:13 -0400][1444.26][test] Notice: REC |10| [04/Aug/1997:16:47:13 -0400][1444.26][test] Notice: REC |syscolumns| [04/Aug/1997:16:47:13 -0400][1444.26][test] Notice: REC |10| [04/Aug/1997:16:47:13 -0400][1444.26][test] Notice: REC |sysindices| [04/Aug/1997:16:47:13 -0400][1444.26][test] Notice: REC |-1| [04/Aug/1997:16:47:13 -0400][1444.26][test] Notice: Sock(http://server.pfn.com:8448): write to 10.1.2.21(266) failed: Result too large (code 34) [04/Aug/1997:16:47:13 -0400][1444.26][test] Notice: SENT |flush 0 | [04/Aug/1997:16:47:13 -0400][1444.26][test] Notice: REC |ok| --- END OF SNIP --- ------------------------------------------------------ Michael Kmiec PFN Incorporated No More Mr. Nice Guy 26 Landsdowne Street Cambridge, MA 02139 mike@pfn.com 617.494.9980 ========================================================================= Date: Tue, 5 Aug 1997 09:20:14 -0700 Reply-To: blakeman@pipedream.com Sender: Web Development with AOLserver From: James Blakeman Organization: pipedream.com Subject: C API Loading Order (How to source TCL from C?) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello, I'm trying to load a few TCL procs from a C module using Ns_TclEval, but I cant' seem to get the procs to "stick". A couple questions: - Should I be able to call Ns_TclEval from a C module initialization procedure? When I do, the TCL is evaluated, but no TCL procs that I define survive the initialization. I suspect that the TCL interpreter isn't available yet. However, I can call "ns_eval" from the initialization function (using Ns_TclEval) and create TCL procss, and then immediately call the procs from the function in the same Ns_TclEval. - What is the load sequence for the so/dlls and interpreter? The TCL API book covers this topic, but it doesn't mention how the C API is loaded. This would help me debug what seems to be an order-of- operation dilema. Thanks. -James blakeman@pipedream.com ========================================================================= Date: Wed, 6 Aug 1997 18:19:50 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Doug McKee Subject: Re: C API Loading Order (How to source TCL from C?) Comments: To: blakeman@pipedream.com Comments: cc: amhoward@aol.com In-Reply-To: <33E752BE.4524@pipedream.com> (message from James Blakeman on Tue, 5 Aug 1997 09:20:14 -0700) >>>>> "James" == James Blakeman writes: James> Hello, I'm trying to load a few TCL procs from a C module James> using Ns_TclEval, but I cant' seem to get the procs to James> "stick". A couple questions: James> - Should I be able to call Ns_TclEval from a C module James> initialization procedure? When I do, the TCL is evaluated, James> but no TCL procs that I define survive the initialization. James> I suspect that the TCL interpreter isn't available yet. James> However, I can call "ns_eval" from the initialization James> function (using Ns_TclEval) and create TCL procss, and then James> immediately call the procs from the function in the same James> Ns_TclEval. James> - What is the load sequence for the so/dlls and James> interpreter? The TCL API book covers this topic, but it James> doesn't mention how the C API is loaded. This would help James> me debug what seems to be an order-of- operation dilema. OK, here's what's going on: When AOLserver starts up, it creates a pool of Tcl interpreters for each virtual server BEFORE calling any module initialization functions. When you call Ns_TclEval, the server grabs one of the Tcl interpreters and evaluates your code in it. Since the command/procedure tables are shared between interpreters, your procs SHOULD be available to all the interpreters. So I'm not sure why this isn't working. BUT, two methods that I know do work are: 1. If you are defining procedures using the Tcl "proc" command, then just put those commands into a .tcl file in the modules/tcl directory of your server or virtual server and it will be sourced into all the interpreters at startup. 1a. Create a subdirectory in one of your modules/tcl directories, and put your .tcl files there. Then add a line "modulename=Tcl" to the ns/server//modules section of your nsd.ini file. 2. If you want to define Tcl commands using C, use the Ns_TclInitInterps function. You specify a function here that will be called for the "parent interpreter" for the virtual server. Before we started sharing the command table (in 2.1), this function would execute your initialization code in each of the virtual server's interpreters. Let us know how it goes, doug -- ------------------------------------------------------------------- Doug McKee, Manager, Web Server Development Email: doug@aol.net America Online, Inc. Voice: (703) 918-1333 8619 Westwood Center Drive Fax: (703) 918-2710 Vienna, VA 22182 ------------------------------------------------------------------- ========================================================================= Date: Thu, 7 Aug 1997 01:12:27 -0700 Reply-To: blakeman@pipedream.com Sender: Web Development with AOLserver From: James Blakeman Organization: pipedream.com Subject: Lets make this fun (re: C API Loading Order) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello again, Well, after messing with this stuff for a few days, I've decided to try an new, capitalistic approach :) If you know AOLserver, have some time, and could use an extra $500+, read on... Here's the Dilemma: I need two AOLserver procedures to wrap up a project, and I don't have time to write them myself. I could either spend a week learning the C API and brushing up on C, or I could offer a reward to the first person to code the solution. Here's the Proposal: If you can figure out the problem outlined below, I'm willing to pay $500 for the code. Add $100 if you can do it by Friday night. For kicks, add another $100 if I can get it to compile the first try, as-is, on Windows NT using Microsoft Visual C++ 4.2. I'll cut a check to the first person that figures it out & gets it to my inbox. I'll post the solver's name to this listserv when the "contest" is finished (hopefully in less than a week). Here's the Specs: As mentioned in earlier posts, I'm looking for a way to encrypt TCL modules and load them into a virtual server. Basically, I don't want my source code to be visible on the hard drive-- I want to store it encrypted on the server and, upon restart, decrypt & load the TCL into the virtual server. The decryption will be done in a compiled C module. It's got to work on AOLserver 2.1 for Windows NT. From what I've thought through, I believe I need two procedures, one in TCL and the other in C. Here are the procedure descriptions that you'll need to comply with: The TCL part: This is the procedure that will be called to encrypt the TCL code before it is installed on the web server: proc tcl_encrypt { tcl_code encryption_key } { # Encrypt the TCL tcl_code using the encryption_key # Note: I'm not looking for killer encryption here. I can't accept # simple "character substitutions", but I'm not asking for 32 # bit encryption either. Just remember that its got to work with the # complete ASCII character set (anything that could show up in a TCL # module) and handle up to 64K of code. E-mail me if you need more # details. No outside calls to UNIX...its got to be encapsulated. # You can assume that the TCL code is valid (no mismatched braces etc) # Return the encrypted code return $encrypted_code } The C Part: Now for the tough part. This involves writing a new TCL command in C using AOLserver's C API. Because its a TCL command, I'll describe what a call would look like from TCL: if ![tcl_install $encrypted_code $server] { ns_log Notice "The code didnt load!" } ...upon calling tcl_install, the routine must decrypt the code, load it into the specified "server", and return 0 or 1. Thats it. After calling this procedure, I need to be able to call any procedures that are defined in the "encrypted_code" (see example below). The Example: So here's what it might look like in real life: # Encrypt some TCL code set encrypted_code [tcl_encrypt "proc mytest { var1 } { ns_log Notice $var1 }" "jerrygarcia"] # Load the encrypted code into the virtual server (this part would be # called on startup): if ![tcl_install $encrypted_code server1] { ns_log Notice "It didn't work!" } The encryption key can be compiled into the C module (or optionally passed in), as it will be customized for various sites. Note: Be sure to try out the sourced code after you call tcl_install... its got to be available to your other TCL code (ie the "mytest" proc in the above example must be available to other procedures). I also need to see sufficient documentation in the code, and of course, the source. Send me some e-mail if you have any other questions. Thanks & good luck! -James blakeman@pipedream.com ========================================================================= Date: Fri, 8 Aug 1997 10:18:43 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Scott Munro Subject: Command susbstitution problem Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Greetings, This is probably more of a Tcl problem than and AOLServer problem. A text column in one of my (Illustra) tables contains ampersand characters ('&'). The problem occurs when I get perform a "ns_set get" to get the column value, ie. set myvar [ns_set get $myrow MyColumnName] where the value of MyColumnName is something like "item 1 & item 2" The results 'myvar' will have a load of crap where the '&' character was. Actually, it's not crap at all... it looks like the previous command executed. I a almost positive that the problem is due to recursive evaluation of the command causing the command interpreter to decide that the '&' indicates stdio redirection. 1. Is this my problem? 2. More importantly, is there anyway to fix this without physically replacing all occurances of the offending '&' character in my database? Regards, Scott Munro Aardvark Interactive, LLC ========================================================================= Date: Fri, 8 Aug 1997 19:32:19 -0500 Reply-To: Stuart Stanley Sender: Web Development with AOLserver From: Stuart Stanley Subject: Tcl not firing Mime-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Ok, this is probably a pretty simple one, but I am getting stumped. I just upgraded gnnserver 2.037 to AolServer 2.2B4. No problem. I now want to start playing with tcl stuff. Ok, no problem IF I stay in modules/tcl. BUT, I want to just drop a .tcl file into a user directory and have it run. IE, if a user wants to tcl script something, thats ok, but I don't want them all having access to nsadmin/modules/tcl. When I put a file there (or in my root page directory, as the documentation seems to sugest is possible), a load of that url (http://something/hello.tcl just shows the tcl source. Any thoughts? "I'm afraid you completely misunderstand ! Ascend HPND the Internet." Masataka Ohta ! Stuart.Stanley@acsend.com ! Eden Prairie, MN. (612)-996-6829 ========================================================================= Date: Sat, 9 Aug 1997 01:09:18 -0400 Reply-To: philg@mit.edu Sender: Web Development with AOLserver From: Philip Greenspun Subject: Tcl not firing Comments: cc: stuarts@netstar.com In-Reply-To: <199708090406.AAA07993@services.web.aol.com> (message from Automatic digest processor on Sat, 9 Aug 1997 00:02:32 -0400) Date: Fri, 8 Aug 1997 19:32:19 -0500 From: Stuart Stanley Subject: Tcl not firing Ok, this is probably a pretty simple one, but I am getting stumped. I just upgraded gnnserver 2.037 to AolServer 2.2B4. No problem. I now want to start playing with tcl stuff. Ok, no problem IF I stay in modules/tcl. BUT, I want to just drop a .tcl file into a user directory and have it run. IE, if a user wants to tcl script something, thats ok, but I don't want them all having access to nsadmin/modules/tcl. When I put a file there (or in my root page directory, as the documentation seems to sugest is possible), a load of that url (http://something/hello.tcl just shows the tcl source. Any thoughts? Read the beta documentation. You have to explicitly enable Tcl page evaluation in the .ini file. This is an incompatible change that has screwed me as well but not as insidious as the "Tcl globals" change. Philip ========================================================================= Date: Mon, 11 Aug 1997 07:30:56 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: "Kriston J. Rehberg" Organization: AOL Web Server Development at http://www.aolserver.com/ Subject: Re: Tcl not firing In-Reply-To: <199708100402.AAA15214@services.web.aol.com> >Read the beta documentation. You have to explicitly enable Tcl page >evaluation in the .ini file. This is an incompatible change that has >screwed me as well but not as insidious as the "Tcl globals" change. I think it's a good feature, and provides significant security that is installed by default. I don't believe, like you do, that people are "screwed" by a minor change like this. The same reasoning is behind the fact that shtml is not turned on by default, nor is CGI. Security first. But, of course, read the docs. As for the shared globals feature that you also mentioned, this is turned off by one line in your nsd.ini: In the section [ns/server/server-name/tcl]" SharedGlobals=On Again, reading the docs helps a little. Kris -- Kriston J. Rehberg http://kriston.web.aol.com/contact/ America Online, Inc. http://members.aol.com/kriston/ Web Server Development http://webdev.web.aol.com/ Vienna, Virginia endeavor to persevere ========================================================================= Date: Mon, 11 Aug 1997 09:59:36 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Krish Menon Subject: RDBMS Licences Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello: Are there any plans to include free exclusive licenses of RDBMS systems with future releases of AOLServer? I currently have 13 clients that use the Tcl API and RDBMS services from Illustra on a Solaris box. Unfortunately, an executive decision has been made by my provider to move all servers to HP-UX boxes. I'm stuck without an alternative -- either I have to buy an RDBMS for HP-UX, or I have to rewrite it to run on NT using ASP. (Bleh). On another note, I just finished reading "Relational Database Backed Web Sites: A Thinking Person's Guide to Web Publishing" by our active list member Phil Greenspun. Its a fabulously written book (if quite opiniated) and is a worthy read. Since it has a lot of case study material using the AOLServer API, its going to help me a great deal. Congratulations, Phil. Krish Menon ========================================================================= Date: Mon, 11 Aug 1997 11:17:40 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Jeff Rawlings Subject: Re: RDBMS Licences Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" At 09:59 AM 8/11/97 -0400, Krish wrote: [...]Unfortunately, >an executive decision has been made by my provider to move all servers to >HP-UX boxes. I'm stuck without an alternative -- either I have to buy an >RDBMS for HP-UX, or I have to rewrite it to run on NT using ASP. (Bleh). Does that mean NT is running on one of your provider's HP boxes?? Actually, you didn't mention a third option: find another provider if this one doesn't meet your needs. >On another note, I just finished reading "Relational Database Backed Web >Sites: A Thinking Person's Guide to Web Publishing" by our active list >member Phil Greenspun. Its a fabulously written book (if quite opiniated) >and is a worthy read. Since it has a lot of case study material using the >AOLServer API, its going to help me a great deal. Congratulations, Phil. I'll second that! Haven't finished the book yet, but I am enjoying the read immensely. Thanks, Philip! --Jeff Rawlings AOL Productions ========================================================================= Date: Mon, 11 Aug 1997 14:40:24 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Stanislav Krasilovskiy Subject: Web Usernames and Passwords in Tcl Scripts MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi, I am relatively new to AOLserver, and I in the next few weeks I will have to set up a database-backed Web site using AOLserver Tcl scripts. The web site which we are currently designing will have many user security checks using login names and passwords. The question that I had was whether it is possible for a Tcl script to obtain the current user's login name after it was authenticated by the browser and AOLserver--in other words, if a Tcl routine can find out which AOLserver user is currently accessing a webpage. I want to stamp all of the information submitted by the user with with his AOLserver login name when I write the information into the database, and I really am looking for a way to do it which would not require the user to re-type his login name and password (to use with ns_passwordcheck) whenever he submits something after he has already been authenticated to access the web page which handles the submission of the information. Thank you for your help. Stan Krasilovskiy Web master/Web programmer Boston University Department of Engineering ========================================================================= Date: Mon, 11 Aug 1997 13:08:07 -0700 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Jeff Huber Organization: AM.net Subject: Re: Web Usernames and Passwords in Tcl Scripts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Stanislav Krasilovskiy wrote: > The question that I had was whether it is possible for a Tcl script to > obtain the current user's login name after it was authenticated by the > browser and AOLserver--in other words, if a Tcl routine can find out > which AOLserver user is currently accessing a webpage. I want to stamp > all of the information submitted by the user with with his AOLserver login You can do this with the Tcl command, ns_conn authuser connId, which returns the decoded user name from the authorization data of the connection.. -- ---------------------------------------------------- | Jeff Huber | AM.net Programmer | | jhuber@am.net | AOLserver Mailing List Moderator | ---------------------------------------------------- -=- Visit Me on the Web: http://am.net/jeff -=- ========================================================================= Date: Wed, 13 Aug 1997 14:58:30 +0200 Reply-To: dormanns@kzs.hu Sender: Web Development with AOLserver From: Dormanns Marcel Organization: Kossuth Zsuzsanna Tech. Highschool Subject: Publishing to AOLserver MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Hi all. I'm not sure this question is specific to AOLserver or a more general question, but here it goes anyway. I wrote a small program in Delphi that automatically converts a bunch of txt files to html. I'm now extending it to publish directly to AOLserver, instead of using AOLpress to create a miniweb and publish this. Until now I succeeded in publishing files, but somehow I'm unable to create subdirectories from my program, only empty files instead. I couldn't find any info on necessary mime types or other info to create a new subdir on the server using a HTTP PUT request. Any info on how to solve this is welcome. Thanks in advance. Marcel. --------------------------------------------------- Marcel Dormanns, system manager Kossuth Zsuzsanna Technical and High School 6800 Hodmezovasarhely, Kaszap u 29, Hungary Tel(work) +36-62-341811 Fax(work) +36-62-344884 ========================================================================= Date: Wed, 13 Aug 1997 10:39:23 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Doug McKee Subject: Re: Publishing to AOLserver Comments: To: dormanns@kzs.hu In-Reply-To: <4F5EF18DB@anett.kzs.hu> (message from Dormanns Marcel on Wed, 13 Aug 1997 14:58:30 +0200) >>>>> "Marcel" == Dormanns Marcel writes: Marcel> Hi all. I'm not sure this question is specific to Marcel> AOLserver or a more general question, but here it goes Marcel> anyway. Marcel> I wrote a small program in Delphi that automatically Marcel> converts a bunch of txt files to html. I'm now extending Marcel> it to publish directly to AOLserver, instead of using Marcel> AOLpress to create a miniweb and publish this. Until now I Marcel> succeeded in publishing files, but somehow I'm unable to Marcel> create subdirectories from my program, only empty files Marcel> instead. I couldn't find any info on necessary mime types Marcel> or other info to create a new subdir on the server using a Marcel> HTTP PUT request. Marcel> Any info on how to solve this is welcome. You need to use the MKDIR method, which as far as I know, hasn't made it into the official HTTP spec. By default, the permissions system treats MKDIR requests the same as PUT requests for purposes of authorization. doug -- ------------------------------------------------------------------- Doug McKee, Manager, Web Server Development Email: doug@aol.net America Online, Inc. 8619 Westwood Center Drive Vienna, VA 22182 ------------------------------------------------------------------- ========================================================================= Date: Wed, 13 Aug 1997 10:49:07 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Doug McKee Subject: Re: RDBMS Licences In-Reply-To: <3.0.1.32.19970811095936.0093a5d0@netrox.net> (message from Krish Menon on Mon, 11 Aug 1997 09:59:36 -0400) >>>>> "Krish" == Krish Menon writes: Krish> Hello: Are there any plans to include free exclusive Krish> licenses of RDBMS systems with future releases of Krish> AOLServer? I currently have 13 clients that use the Tcl API Krish> and RDBMS services from Illustra on a Solaris Krish> box. Unfortunately, an executive decision has been made by Krish> my provider to move all servers to HP-UX boxes. I'm stuck Krish> without an alternative -- either I have to buy an RDBMS for Krish> HP-UX, or I have to rewrite it to run on NT using Krish> ASP. (Bleh). Krish> On another note, I just finished reading "Relational Krish> Database Backed Web Sites: A Thinking Person's Guide to Web Krish> Publishing" by our active list member Phil Greenspun. Its a Krish> fabulously written book (if quite opiniated) and is a Krish> worthy read. Since it has a lot of case study material Krish> using the AOLServer API, its going to help me a great Krish> deal. Congratulations, Phil. I highly recommend the book to all people interested in any one of: * Getting real examples of writing AOLserver apps * Learning more about db-backed web sites in general * Just a jolly-good read! doug ------------------------------------------------------------------- Doug McKee, Manager, Web Server Development Email: doug@aol.net America Online, Inc. 8619 Westwood Center Drive Vienna, VA 22182 ------------------------------------------------------------------- ========================================================================= Date: Wed, 13 Aug 1997 10:53:18 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Doug McKee Subject: Re: RDBMS Licences In-Reply-To: <3.0.1.32.19970811095936.0093a5d0@netrox.net> (message from Krish Menon on Mon, 11 Aug 1997 09:59:36 -0400) >>>>> "Krish" == Krish Menon writes: Krish> Hello: Are there any plans to include free exclusive Krish> licenses of RDBMS systems with future releases of Krish> AOLServer? I currently have 13 clients that use the Tcl API Krish> and RDBMS services from Illustra on a Solaris Krish> box. Unfortunately, an executive decision has been made by Krish> my provider to move all servers to HP-UX boxes. I'm stuck Krish> without an alternative -- either I have to buy an RDBMS for Krish> HP-UX, or I have to rewrite it to run on NT using Krish> ASP. (Bleh). There are definitely no plans to include free exclusive licenses to RDBMS's with future releases of AOLserver. BUT, I highly recommend the reasonably priced Solid dbms, and we do still distribute a database driver for the freely available Postgres database. In related news, we will be releasing new and improved documentation on how to write internal and external database drivers for AOLserver which should make it much easier for you all to build drivers for other databases, freely available and commercial. doug ------------------------------------------------------------------- Doug McKee, Manager, Web Server Development Email: doug@aol.net America Online, Inc. 8619 Westwood Center Drive Vienna, VA 22182 ------------------------------------------------------------------- ========================================================================= Date: Fri, 15 Aug 1997 17:25:44 -0700 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Jeff Huber Organization: AM.net Subject: Bug in Tcl's lindex command MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit We have discovered the following bug in Tcl's lindex command. If you have a list with 9 elements or more and you do a lindex $list 07, lindex returns the 7th element of the list, like it is suppose to. Now here is where the bug is. If you do lindex $list 08, Tcl throws an error. For example: set list "item0 item1 item2 item3 item4 item5 item6 item7 item8 item9" lindex $list 07 returns: item7 ...but... set list "item0 item1 item2 item3 item4 item5 item6 item7 item8 item9" lindex $list 08 throws an error and returns: expected integer but got "08" This error occurs with any index passed to lindex which is greater then 8 and begins with a 0. So lindex $list 09, lindex $list 010, lindex $list 011, etc. all throw errors... This might be a known bug in Tcl, but I found no documentation on Sun's Tcl site (http://sunscript.sun.com/) about this bug, or any documentation saying this bug has been fixed in newer versions of Tcl. I only know that the bug exists in Tcl 7.4 and 7.5.. We did write some code to fix this bug by renaming the lindex command and then creating a Tcl procedure named lindex. If you stick the following code in your init.tcl file, it should fix the lindex bug. The code is: catch {rename lindex lindex_old} proc lindex {list element} { if {$element != 0} { set element [string trimleft $element 0] } return [lindex_old $list $element] } (We have also found this same bug in lrange. The code to fix lrange would be similar.) -- ---------------------------------------------------- | Jeff Huber | AM.net Programmer | | jhuber@am.net | AOLserver Mailing List Moderator | ---------------------------------------------------- -=- Visit Me on the Web: http://am.net/jeff -=- ========================================================================= Date: Sat, 16 Aug 1997 01:03:38 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Krish Menon Subject: Re: Bug in Tcl's lindex command In-Reply-To: <33F4F388.3816FB8@am.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" At 05:25 PM 8/15/97 -0700, you wrote: >We have discovered the following bug in Tcl's lindex command. If you >have a list with 9 elements or more and you do a lindex $list 07, lindex >returns the 7th element of the list, like it is suppose to. Now here is >where the bug is. If you do lindex $list 08, Tcl throws an error. > > Hi Jeff: That's not an error. Its simply following standard Octal notation. Krish Krish Menon Webgnostic/Strategist krish@araneum.com ========================================================================= Date: Sat, 16 Aug 1997 10:11:59 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Krish Menon Subject: is it 'env' a command or a variable? [FWD] Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" >Return-Path: >X-Sender: marco.coletti@mail.bearnet.it >Date: Sat, 16 Aug 1997 12:00:34 +0200 >From: marco.coletti@eurofin.it (Marco Coletti) >Subject: is it 'env' a command or a variable? > > >Seems like the implementors of the AOLserver TCL API mistakenly intended >'env' (wich should be a global automatic variable maintained by TCL) as a >TCL command. > >>From AOLserver 2.1 Tcl Developer's Guide, Tcl Reference manual, item >"tclvars tcl": > >......................................................... >env >This variable is maintained by Tcl as an array whose elements are the >environment variables for the process. Reading an element will return the >value of the corresponding environment variable. Setting an element of the >array will modify the corresponding environment variable or create a new one >if it doesn't already exist. Unsetting an element of env will remove the >corresponding environment variable. Changes to the env array will affect >the environment passed to children by commands like exec. If the entire env >array is unset then Tcl will stop monitoring env accesses and will not >update environment variables. >......................................................... > >But AOLserver's TCL 7.4 API doesn't agree: >........................... >format $env(PATH) > >Your Tcl evaluation threw an error: > >can't read "env(PATH)": no such variable >........................... > >Instead, 'env' is recognized as a command: >........................... >env > >Your Tcl evaluation threw an error: > >wrong # args: should be "env command ?args ...?" >........................... >env foobar > >Your Tcl evaluation threw an error: > >unknown command "foobar": should be exists, names, get, set, or unset >........................... >env get PATH > >Your Tcl evaluation returned the following result: > >E:\WINNT35\system32;E:\WINNT35;E:\ResKit35;E:\bin; >........................... > > >I wonder what is going on... > > >------------------------------------------------------------ -= MarCo =- >PGP public key: >http://keys.pgp.com:11371/pks/lookup?op=get&exact=on&search=0x96A79061 >http://www.pgp.net/cgi-bin/pks-extract-key.pl?op=index&search=0x96A79061 >Fingerprint: 9F E5 80 61 F6 9F 05 2D EA 53 6F 2D 82 8B C7 C2 >------------------------------------------------------------------------ > > Krish Menon Webgnostic/Strategist krish@araneum.com ========================================================================= Date: Sat, 16 Aug 1997 10:54:26 -0400 Reply-To: jim@meritnet.com Sender: Web Development with AOLserver From: Jim Wilcoxson Organization: Merit Software, Inc. Subject: Re: Bug in Tcl's lindex command Comments: To: Jeff Huber MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit > ... If you do lindex $list 08, Tcl throws an error. Uh, I don't think this is a TCL bug. Any number preceeded with a zero means that the number should be interpreted as octal, and 08 is not octal, so TCL is throwing up, I mean, an error. Jim ========================================================================= Date: Sat, 16 Aug 1997 03:33:08 -0000 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: johnm-aolserver@non.net Subject: Bug in Tcl's lindex command In-Reply-To: <33F4F388.3816FB8@am.net> >>>>> "Jeff" == Jeff Huber writes: [...] > We have discovered the following bug in Tcl's lindex command. If you have > a list with 9 elements or more and you do a lindex $list 07, lindex > returns the 7th element of the list, like it is suppose to. Now here is > where the bug is. If you do lindex $list 08, Tcl throws an error. That's not a 'bug'. You've specified an illegal octal numeric constant. In this respect, Tcl is very strictly following the C language definition that unless the first two characters are "0x" or "0X" then any number starting with the digit 0 is in octal notation. It does seem that the error message being generated in your example is, at best, unhelpful. [...] > We did write some code to fix this bug by renaming the lindex command and > then creating a Tcl procedure named lindex. If you stick the following > code in your init.tcl file, it should fix the lindex bug. The code is: I very strongly recommend against replacing the standard tcl functions. I recommend that you follow the standard Tcl numeric conventions too but if you really don't like it then at least use your replacements but change their names so that other people won't get totally hosed. Hope this helps, John ========================================================================= Date: Sat, 16 Aug 1997 20:45:45 +0200 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: woba Organization: 3d-pyro-group Subject: TCL and HTML Development Environment MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To the AOLserver development community. During the last months, I heavily modified and extended the nice "easytcl" script written by Hal M. Heisler. You may find the original on primehosts "share your code" page. ** Now there are two framed-versions available: for GNNserver v2.033 and AOLserver >= v2.1 -------- Features: nicely formatted create, edit TCL HTML files reinit-tcl, refresh-tcl-html-dirs, user-group-perm-administration simple Statistics script: 1. *htm*_accesses(all IP's) 2. page_accesses(single IP) 3. time_dependent_accesses(single IP)(hour-grained) subdir evaluation informative main pages may be used standalone numerous helpful additions you might discover after a while :-))) ** for the private-gequal-2.1 version only: ** create dirs and subdirs in TCL and HTML vserver-root directories -------- You may take a look at the gequal-2.1 version on http://joy.tp3.ruhr-uni-bochum.de/NS/TCL Enter "guest,easytcl" as user-password combination ** File names: HTML-editing: easyhtml.tcl TCL-devel: easytcl.tcl Statistics: al_v012.tcl ** Installation: v2.033: copy scripts to your -modules-tcl directory add permissions to GET and POST "NS/TCL" "NS/HTML" "NS/AL[PT]" reinit-tcl append NS/TCL to your home-page-URL i.e.: http:///NS/TCL gequal-2.1: the installation is different, cause I only had time to adapt it to act in the *private* environment. this means that you have to copy the scripts to *each* virtual servers private-tcl directory: in my case: /servers/server[n]/modules/tcl all other is the same as above. ** Download: you have two possibilities: 1. get the scripts directly from: ftp://joy.tp3.ruhr-uni-bochum.de/pub/AOLserver/tcl/2.033/ or ftp://joy.tp3.ruhr-uni-bochum.de/pub/AOLserver/tcl/gequal-2.1/private/ 2. use the guest-login and click on the FTP-Link in the navigation window ** Here's the misc stuff: Use or modify this code at your own taste and risk. But please, don't make me responsible for malfunction or crashes that might occur during operation . Remember: Software development takes time and thus, software being in an intermediate state is never free of errors. If you like it, send me mail in reply or mailto:woba@dortmund.net ---- W.Bathelt Admin Theoretical Physics III TPIII home-page: http://www.tp3.ruhr-uni-bochum.de/ Building NB6 Ruhr University Bochum Germany-NRW mailto:woba@tp3.ruhr-uni-bochum.de --------------------------------- ========================================================================= Date: Sat, 16 Aug 1997 14:04:24 -0700 Reply-To: "akhassin@am.net" Sender: Web Development with AOLserver From: Alex Khasssin Organization: AM Computers Subject: Re: is it 'env' a command or a variable? [FWD] MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit > > > >Instead, 'env' is recognized as a command: > >........................... env is definately a command in AOLServer (though undocumented): env tcl env set var value env get var env unset var env exits var env names env works with the environmental variables: set sets an environmental variable get returns the value of the specified environmental variable unset unsets the specified environmental variable exists returns 1 if the variable is set, 0 if not names returns a list of the environmental variables (the names only, not values) -- ---------------------------------------------------------------- Alex Khassin AM Computers mailto:akhassin@am.net 1040-B N. Dutton Ave Voice: (800) 579-2018 Santa Rosa, CA 95401 (707) 579-2010 http://am.net ---------------------------------------------------------------- The Source for Advanced Computing Solutions ---------------------------------------------------------------- am.net = The Best Hosting Service with integrated database, secure transactions, real-time credit card processing and more ---------------------------------------------------------------- ========================================================================= Date: Sun, 17 Aug 1997 01:41:06 +0200 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Marco Coletti Subject: ns_rename Comments: To: Krish Menon Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" It seems the TCL command ns_rename is not recognized by AOLserver 2.1 nor by 2.2b4. I don't know for the other versions. From AOLserver 2.1 Tcl API Function Reference: ..................................................... ns_rename Overview Rename a file Syntax ns_rename file1 file2 Description ns_rename renames the first file (file1) with the name specified in file2. ..................................................... So what? ------------------------------------------------------------ -= MarCo =- PGP public key: http://keys.pgp.com:11371/pks/lookup?op=get&exact=on&search=0x96A79061 http://www.pgp.net/cgi-bin/pks-extract-key.pl?op=index&search=0x96A79061 finger://mail.eurofin.it/marco.coletti Fingerprint: 9F E5 80 61 F6 9F 05 2D EA 53 6F 2D 82 8B C7 C2 ------------------------------------------------------------------------ ========================================================================= Date: Sat, 16 Aug 1997 17:31:03 -0700 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Jeff Huber Organization: AM.net Subject: Re: ns_rename MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Marco Coletti wrote: > > It seems the TCL command ns_rename is not recognized by AOLserver 2.1 nor by > 2.2b4. > I don't know for the other versions. > > >From AOLserver 2.1 Tcl API Function Reference: > > ..................................................... > ns_rename > Overview > Rename a file > Syntax > ns_rename file1 file2 > Description > ns_rename renames the first file (file1) with the name specified in > file2. > ..................................................... That is interesting, because I am looking at the online documentation for the AOLServer 2.1 API and I can not find any documentation for a ns_rename command. Here at AM.net we have a Tcl procedure to rename files called am_renameFile. It simply copies file1 to file2 and deletes file1. Here is the code: proc am_renameFile {file1 file2} { ns_cp $file1 $file2 ns_unlink $file1 } -- ---------------------------------------------------- | Jeff Huber | AM.net Programmer | | jhuber@am.net | AOLserver Mailing List Moderator | ---------------------------------------------------- -=- Visit Me on the Web: http://am.net/jeff -=- ========================================================================= Date: Sun, 17 Aug 1997 02:00:21 +0200 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Marco Coletti Subject: ns_accesslog not available during startup? Comments: To: Krish Menon Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" AOLserver 2.2beta4 for Solaris. I found the command ns_accesslog file fails if included outside a TCL proc (i.e. at level 0) causing the interruption of the .tcl file sourcing, altough it works perfectly if executed after server has finished starting (i.e. inside a proc). This prevents me from using it to initialize a global var, i.e. set accessLogFile [ns_accesslog file] I searched through all the built in AOLserver .tcl files (shared TCL lib) suspecting that ns_accesslog could be simply a TCL proc (in this case it would be possible that it is sourced after my personal .tcl file), but no success. Since I don't know now about other versions, I'm not sure if this is a bug of the 2.2beta4 version, and therefore I chose to submit the issue to the list instead of to feedback@aolserver.com Ciao. ------------------------------------------------------------ -= MarCo =- PGP public key: http://keys.pgp.com:11371/pks/lookup?op=get&exact=on&search=0x96A79061 http://www.pgp.net/cgi-bin/pks-extract-key.pl?op=index&search=0x96A79061 finger://mail.eurofin.it/marco.coletti Fingerprint: 9F E5 80 61 F6 9F 05 2D EA 53 6F 2D 82 8B C7 C2 ------------------------------------------------------------------------ ========================================================================= Date: Sun, 17 Aug 1997 02:11:19 +0200 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Marco Coletti Subject: Re: is it 'env' a command or a variable? Comments: To: Krish Menon Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" At 14.04 16/08/97 -0700, Alex Khasssin wrote: >> > >> >Instead, 'env' is recognized as a command: >> >........................... > >env is definately a command in AOLServer (though undocumented): IT IS documented, but as a global Tcl variable!! :-) (AOLserver 2.1 Tcl Developer's Guide, Tcl Reference manual, item "tclvars tcl") I would say, it is mis-documented. That piece of the manual is taken directly from the Tcl 7.4 standard manual. The standard behaviour of 'env' should be that of an array variable. I don't see from where the AS developers got the idea to implement it as a command... ------------------------------------------------------------ -= MarCo =- PGP public key: http://keys.pgp.com:11371/pks/lookup?op=get&exact=on&search=0x96A79061 http://www.pgp.net/cgi-bin/pks-extract-key.pl?op=index&search=0x96A79061 finger://mail.eurofin.it/marco.coletti Fingerprint: 9F E5 80 61 F6 9F 05 2D EA 53 6F 2D 82 8B C7 C2 ------------------------------------------------------------------------ ========================================================================= Date: Sun, 17 Aug 1997 01:41:14 -0000 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: johnm-aolserver@non.net Subject: Tcl v8.0 Well, now that Tcl v8.0 has been released (check out comp.lang.tcl.announce :-) is there any idea when AOLServer will upgrade to it? I really want namespaces... Take care, John ========================================================================= Date: Sat, 16 Aug 1997 23:02:35 -0700 Reply-To: blakeman@pipedream.com Sender: Web Development with AOLserver From: James Blakeman Organization: pipedream.com Subject: Useful 2-liner: ns_log2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello everyone, I thought I'd pass on a two-liner that's making AOLserver development a bit easier. If you're managing huge amounts of code, this small utility will come in handy-- if you've got "ns_log Notice ..." debugging calls spread throughout your code, "ns_log2" provides some relief as: 1) An easy way to figure out where ns_log is being called from. ns_log2 uses TCL's [info level] command to append a traceback of calling procedures, so if you call ns_log2 from some obscure module, the log will look like this: [16/Aug/1997:17:32:19 -0700][231.282][my_server] Notice: The new length is 964 (fg_Load_DLL) Note that the calling proc (fg_Load_DLL) is displayed after the message text. You won't have to guess where those ns_log debug calls are hiding anymore... 2) A way to make your log messages stand out with color. 'Just use any HTML color name or RGB triplet as the optional third parameter. A few notes about this feature: - To see your log in color, you'll need to remove the [ns_striphtml] command at the bottom of showlog.tcl. Comment it out, or make a backup if you are new to TCL or AOLserver. - On rare occasions, your log file may turn odd colors if you happen to leave an HTML tag unclosed. I've found that the benefits of color far outweigh this rare inconvenience...especially when I'm dumping tons of debug material to the log. Plus, you can include HTML tags (HR, P, H3) in your ns_log2 calls to further enhance logs. Avoid the BLINK tag...trust me! Note that ns_log is still available, so you can use them side by side. You might even consider expanding the proc to trace up the calling stack further. Let me know if you have any feedback (mailto:blakeman@pipedream.com) -James # ns_log2 (1996/09/02) feedback to: blakeman@pipedream.com # # This procedure is a wrapper for ns_log that appends the calling proc's information # to the log message and optionally colors the log text using the HTML "FONT" tag. # # Other that the optional Color parameter, this procedure should be called just like # AOLserver's ns_log proc. # proc ns_log2 { Type Message {Color #000000} } { set calling_proc [lindex [info level [expr [info level] - 1]] 0] ns_log $Type "$Message ($calling_proc)" } ========================================================================= Date: Sun, 17 Aug 1997 17:45:36 +0200 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Marco Coletti Subject: Re: ns_rename Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" At 17.31 16/08/97 -0700, you wrote: >> It seems the TCL command ns_rename is not recognized by AOLserver 2.1 nor by >That is interesting, because I am looking at the online documentation >for the AOLServer 2.1 API and I can not find any documentation for a >ns_rename command. I'm using the first released version 2.1 .pdf documentation. Maybe they revised it and got rid of that page... Anyway there is not a substitute for that command. Tcl 8.0 provides the command file rename ?-force? ?--? source target but AS 2.1 and 2.2beta4 say 'bad option "rename"'. >Here at AM.net we have a Tcl procedure to rename files called >am_renameFile. It simply copies file1 to file2 and deletes file1. Here >is the code: > >proc am_renameFile {file1 file2} { > ns_cp $file1 $file2 > ns_unlink $file1 >} Perhaps I'm a bit pedantic, but this is not quite the same thing. 'ns_rename' or 'file rename...' are supposed to map to a C function which in turn maps to a system call that, when target and source are on the same physical disk, moves only directory entries, not the file contents. Certainly it works that way when target and source are in the same directory. This is going to make a big difference, for example, when renaming log files, which frequently are in the range of the megabytes. ------------------------------------------------------------ -= MarCo =- PGP public key: http://keys.pgp.com:11371/pks/lookup?op=get&exact=on&search=0x96A79061 http://www.pgp.net/cgi-bin/pks-extract-key.pl?op=index&search=0x96A79061 finger://mail.eurofin.it/marco.coletti Fingerprint: 9F E5 80 61 F6 9F 05 2D EA 53 6F 2D 82 8B C7 C2 ------------------------------------------------------------------------ ========================================================================= Date: Sun, 17 Aug 1997 10:47:36 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: JGDavidson@aol.com Subject: Re: is it 'env' a command or a variable? In a message dated 97-08-17 00:45:52 EDT, you write: > At 14.04 16/08/97 -0700, Alex Khasssin wrote: > >> > > >> >Instead, 'env' is recognized as a command: > >> >........................... > > > >env is definately a command in AOLServer (though undocumented): > > IT IS documented, but as a global Tcl variable!! :-) > (AOLserver 2.1 Tcl Developer's Guide, Tcl Reference manual, item "tclvars > tcl") > I would say, it is mis-documented. > > That piece of the manual is taken directly from the Tcl 7.4 standard manual. > The standard behaviour of 'env' should be that of an array variable. > > I don't see from where the AS developers got the idea to implement it as a > command... Hello, Well, I wrote the code. There were three reasons I changed env from a variable to a command: 1. Environment variables are not case-sensitive on NT - getenv("Path") returns the same thing as getenv("PATH") on NT. The env variable code always copied the variables and preserved case into a Tcl array so you may think $env(PATH) wasn't set when in fact $env(Path) was set. This could cause problems in, for example, preparing for an exec. The env command does the right thing and returns the same value on NT with: env get Path or: env get PATH 2. The implementation of env as a variable was not thread safe. It was either a few hours work to change env to a command or several days work to re-write what was actually one of the messier parts of the Tcl core to make it thread safe. 3. env as a command is a safer implementation. It always fetches, in a thread safe way, the actual environment variables. In the env variable code, the environment variables are copied to the env global array at Tcl interp startup and so if ordinary C code changes the environment with, for example a putenv("foo=bar"), the env array wouldn't see the change. I think that's a pretty unsafe interface to be using, especially in the AOLserver were both C and Tcl modules can be interacting simultaneously in unpredictable ways. Of course not documenting this was a silly oversight! Sorry about that. Cheers, -Jim ========================================================================= Date: Sun, 17 Aug 1997 10:55:50 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: JGDavidson@aol.com Subject: Re: ns_accesslog not available during startup? In a message dated 97-08-17 07:21:17 EDT, you write: > AOLserver 2.2beta4 for Solaris. > > I found the command > > ns_accesslog file > > fails if included outside a TCL proc (i.e. at level 0) causing the > interruption of the .tcl file sourcing, altough it works perfectly if > executed after server has finished starting (i.e. inside a proc). This > prevents me from using it to initialize a global var, i.e. > > set accessLogFile [ns_accesslog file] > > I searched through all the built in AOLserver .tcl files (shared TCL lib) > suspecting that ns_accesslog could be simply a TCL proc (in this case it > would be possible that it is sourced after my personal .tcl file), but no > success. > > Since I don't know now about other versions, I'm not sure if this is a bug > of the 2.2beta4 version, and therefore I chose to submit the issue to the > list instead of to feedback@aolserver.com Hello, The ns_accesslog command is added by the nslog.so module when loaded. Try putting your init script which uses ns_accesslog in a .tcl file in a private or shared nslog Tcl subdirectory which AOLserver will look for after loading nslog.so. For example, if nsd.ini loads nslog.so with: nslog=nslog.so than AOLserver will search for Tcl scripts in: servers//modules/tcl/nslog/ and: modules/tcl/nslog/ One more thing: You probably want to use a shared variable, not a global variable, for your access log file: ns_share -init [ns_accesslog file] accessLogFile Global variables are no longer shared among interps by default. -Jim ========================================================================= Date: Sun, 17 Aug 1997 09:30:01 -0700 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Jeff Huber Organization: AM.net Subject: Re: ns_rename MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Marco Coletti wrote: > Perhaps I'm a bit pedantic, but this is not quite the same thing. > 'ns_rename' or 'file rename...' are supposed to map to a C function which in > turn maps to a system call that, when target and source are on the same > physical disk, moves only directory entries, not the file contents. > Certainly it works that way when target and source are in the same directory. > This is going to make a big difference, for example, when renaming log > files, which frequently are in the range of the megabytes. You are correct that Tcl procedure is a bit of a hack, but it is portable, and if you are renaming small files there is not a significant performance problem. Of course you could do something like: proc ns_rename {file1 file2} { exec "mv $file1 $file2" } But, this is not platform independent. -- ---------------------------------------------------- | Jeff Huber | AM.net Programmer | | jhuber@am.net | AOLserver Mailing List Moderator | ---------------------------------------------------- -=- Visit Me on the Web: http://am.net/jeff -=- ========================================================================= Date: Sun, 17 Aug 1997 19:54:05 +0200 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Marco Coletti Subject: Re: ns_accesslog not available during startup? Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" At 10.55 17/08/97 -0400, JGDavidson@aol.com wrote: >> I found the command >> >> ns_accesslog file >> >> fails if included outside a TCL proc (i.e. at level 0) causing the >> interruption of the .tcl file sourcing, altough it works perfectly if >> executed after server has finished starting (i.e. inside a proc). This >The ns_accesslog command is added by the nslog.so module when loaded. Try >putting your init script which uses ns_accesslog in a .tcl file in a private >or shared nslog Tcl subdirectory which AOLserver will look for after loading >nslog.so. For example, if nsd.ini loads nslog.so with: > >nslog=nslog.so > >than AOLserver will search for Tcl scripts in: > >servers//modules/tcl/nslog/ > >and: > >modules/tcl/nslog/ Yes, but, generally speaking, how can I make sure that AS will look at my .tcl files *after* having loaded *all* the required native modules? Splitting my .tcl files and scattering them around the modules subdirs depending on what Tcl commands they execute at source time is not very exciting. Nor it is trying to guess at what is the last module subdir being sourced and put in there my .tcl files. Shouldn't AS source the .tcl files after having done all of its initialization? I mean, it could first read from nsd.ini what are the modules to load (native and user Tcl pseudo-modules), then load the native modules, then source all the .tcl files - except those contained in user Tcl pseudo-modules subdirs - and finally source user Tcl pseudo-modules subdirs... This way, by placing my .tcl files in a modules/tcl/ or servers//modules/tcl/ subdir of my choice, organized as a Tcl pseudo-module, I could be sure that they are sourced last, when all the built-in commands (and even the Tcl procs coming with AS) are available. At least, is it possible to impose the module loading order by ordering the keys in section [ns/server//modules] of nsd.ini? Another related question would be how can I impose a sourcing sequence order among my .tcl files... so that I can know whether a proc of mines, which I'm going to call from level 0 in one of my files, is available. Ciao. ------------------------------------------------------------ -= MarCo =- PGP public key: http://keys.pgp.com:11371/pks/lookup?op=get&exact=on&search=0x96A79061 http://www.pgp.net/cgi-bin/pks-extract-key.pl?op=index&search=0x96A79061 finger://mail.eurofin.it/marco.coletti Fingerprint: 9F E5 80 61 F6 9F 05 2D EA 53 6F 2D 82 8B C7 C2 ------------------------------------------------------------------------ ========================================================================= Date: Sun, 17 Aug 1997 21:37:08 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: "Kriston J. Rehberg" Organization: AOL Web Server Development at http://www.aolserver.com/ Subject: Re: ns_rename In-Reply-To: <199708170403.AAA24777@services.web.aol.com> >It seems the TCL command ns_rename is not recognized by AOLserver 2.1 nor by >2.2b4. >I don't know for the other versions. I can tell you that it exists and appears to be working fine in AOLserver 2.11 (at least in my code it is). Here's a snippit of how I used it to rename a file uploaded with the Netscape File Widget as a simple file swapper: ns_rename [ns_info pageroot]/storeinfo/$store_mname/temp \ [ns_info pageroot]/storeinfo/$store_mname/background.$ext Although I'm moving files within my pageroot, you should be able to move any file on the system, and any directory within a filesystem (mv can't traverse filesystems when moving directories). At least make sure that the files and the directories in which they exist are read/write accessible to the username that's running the AOLserver (in nsd.ini, it's in section [ns/parameters], key "User"). Regards, Kris Rehberg -- Kriston J. Rehberg http://kriston.web.aol.com/contact/ America Online, Inc. http://members.aol.com/kriston/ Web Server Development http://webdev.web.aol.com/ Vienna, Virginia endeavor to persevere ========================================================================= Date: Mon, 18 Aug 1997 13:47:58 +0200 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Marco Coletti Subject: Re: ns_rename Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" >>It seems the TCL command ns_rename is not recognized by AOLserver 2.1 nor by >>2.2b4. >I can tell you that it exists and appears to be working fine in >AOLserver 2.11 (at least in my code it is). That's funny... Does anybody know whether the version for Intel NT currently on the AOLserver site (http://www.aolserver.com/server/download.html#download) is 2.1 or 2.11 ? Is there such a thing as AOLserver 2.11 for Intel NT? ------------------------------------------------------------ -= MarCo =- PGP public key: http://keys.pgp.com:11371/pks/lookup?op=get&exact=on&search=0x96A79061 http://www.pgp.net/cgi-bin/pks-extract-key.pl?op=index&search=0x96A79061 finger://mail.eurofin.it/marco.coletti Fingerprint: 9F E5 80 61 F6 9F 05 2D EA 53 6F 2D 82 8B C7 C2 ------------------------------------------------------------------------ ========================================================================= Date: Mon, 18 Aug 1997 09:01:49 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Doug McKee Subject: AOLserver 2.2 beta 5 released Some of you have already noticed that AOLserver beta 5 was released late on Friday, but for those that haven't, I encourage you to check it out. It is our last 2.2 beta release, and we plan on releasing the final 2.2 within the next two weeks. Highlights include: * Several fixes and tweeks to AOLserver Dynamic Pages (ADP's) - In memory caching of parsed ADP's - ns_adp_break and ns_adp_abort for stopping in the middle of ADP processing - <%...%> and <%=...%> can now be used inside HTML tags - globals are now flushed after processing trace functions - Some parsing problems are fixed * Ability to break configuration information into several files * The LogSQLErrors parameter lets you only log SQL statements that cause errors. * A longstanding external db driver crash bug is fixed. See http://www.aolserver.com/server/beta/index.html#Beta5 for the details. doug ------------------------------------------------------------------- Doug McKee, Manager, Web Server Development Email: doug@aol.net America Online, Inc. 8619 Westwood Center Drive Vienna, VA 22182 ------------------------------------------------------------------- ========================================================================= Date: Mon, 18 Aug 1997 00:06:08 -0700 Reply-To: blakeman@pipedream.com Sender: Web Development with AOLserver From: James Blakeman Organization: pipedream.com Subject: Re: Lets make this fun (C API & encryption) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Just to let everyone know (in case there are still some more people out there trying to write the encryption code & take the $700 purse) The problem was solved last Friday (in time for the deadline) by Jeff Huber & the folks at AM.net. I spent the week verifying the solution & everything works great. Thanks again to everyone who took a stab at the problem...we may do this again sometime. -James blakeman@pipedream.com ========================================================================= Date: Mon, 18 Aug 1997 09:49:59 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Michael Jennings Subject: Re: Bug in Tcl's lindex command In-Reply-To: <3.0.1.32.19970816010338.0093b810@netrox.net>; from Krish Menon on Sat, Aug 16, 1997 at 01:03:38AM -0400 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Saturday, 16 August 1997, at 01:03:38 (-0400), Krish Menon wrote: > >We have discovered the following bug in Tcl's lindex command. If you > >have a list with 9 elements or more and you do a lindex $list 07, lindex > >returns the 7th element of the list, like it is suppose to. Now here is > >where the bug is. If you do lindex $list 08, Tcl throws an error. > > That's not an error. Its simply following standard Octal notation. First let me say that I'm a C programmer, not a Tcl programmer. So I may be way off base, and I have not done any testing on my own. At first it appeared to me that lindex was following the convention of the C function strotoul(char *, 0, 0) and interpreting the number as octal if preceeded by a 0. However, Jeff states that the error is also thrown by 010 and 011, which are both valid octal numbers. If this is indeed the case, then there does appear to be a bug there.... Michael -- "As your attorney, it is my duty to inform you that it is not important that you understand what I'm doing or why you're paying me so much money. What's important is that you continue to do so." -- Hunter S. Thompson's Attorney ======================================================================= Michael Jennings (KainX!mejenn01@irc.louisville.edu) TACH System Administrator http://www.spd.louisville.edu/~mejenn01/ ========================================================================= Date: Mon, 18 Aug 1997 11:22:03 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Doug McKee Subject: Re: ns_rename Comments: cc: amhoward@aol.com In-Reply-To: <2.2.32.19970818114758.006bf5b8@mail.bearnet.it> (message from Marco Coletti on Mon, 18 Aug 1997 13:47:58 +0200) OK, for the record: * ns_rename did not exist in 2.1 or any of the 2.2 betas. * ns_rename will exist in the released version of 2.2; I just added it. * AOLserver 2.11 was an AOL-internal build that we never released publically; trust me that you weren't missing much. doug -- ------------------------------------------------------------------- Doug McKee, Manager, Web Server Development Email: doug@aol.net America Online, Inc. Voice: (703) 918-1333 8619 Westwood Center Drive Fax: (703) 918-2710 Vienna, VA 22182 ------------------------------------------------------------------- ========================================================================= Date: Mon, 18 Aug 1997 11:29:21 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Doug McKee Subject: Re: Tcl v8.0 In-Reply-To: <19970817014114.26459.qmail@non.net> (johnm-aolserver@NON.NET) >>>>> "John" == johnm-aolserver writes: John> Well, now that Tcl v8.0 has been released (check out John> comp.lang.tcl.announce :-) is there any idea when AOLServer John> will upgrade to it? John> I really want namespaces... We are definitely planning on upgrading to it, but it may be a little while. We made significant modifications to the Tcl source code to make it thread-safe, and will probably need to make similar changes to the Tcl8.0 source tree. We're particularly looking forward to the higher performance and binary I/O functionality. doug -- ------------------------------------------------------------------- Doug McKee, Manager, Web Server Development Email: doug@aol.net America Online, Inc. Voice: (703) 918-1333 8619 Westwood Center Drive Fax: (703) 918-2710 Vienna, VA 22182 ------------------------------------------------------------------- ========================================================================= Date: Mon, 18 Aug 1997 11:41:53 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Doug McKee Subject: Re: ns_accesslog not available during startup? In-Reply-To: <2.2.32.19970817175405.006a5508@mail.bearnet.it> (message from Marco Coletti on Sun, 17 Aug 1997 19:54:05 +0200) >>>>> "Marco" == Marco Coletti writes: Marco> At 10.55 17/08/97 -0400, JGDavidson@aol.com wrote: >>> I found the command >>> >>> ns_accesslog file >>> >>> fails if included outside a TCL proc (i.e. at level 0) causing >>> the interruption of the .tcl file sourcing, altough it works >>> perfectly if executed after server has finished starting >>> (i.e. inside a proc). This >> The ns_accesslog command is added by the nslog.so module when >> loaded. Try putting your init script which uses ns_accesslog >> in a .tcl file in a private or shared nslog Tcl subdirectory >> which AOLserver will look for after loading nslog.so. For >> example, if nsd.ini loads nslog.so with: >> >> nslog=nslog.so >> >> than AOLserver will search for Tcl scripts in: >> >> servers//modules/tcl/nslog/ >> >> and: >> >> modules/tcl/nslog/ Marco> Yes, but, generally speaking, how can I make sure that AS Marco> will look at my .tcl files *after* having loaded *all* the Marco> required native modules? Create a new directory under modules/tcl and put your files there. Then add a line to the [ns/server//modules] section of your nsd.ini file called "=Tcl" at the end. Your files will be sourced after all the other modules have loaded. Marco> Splitting my .tcl files and scattering them around the Marco> modules subdirs depending on what Tcl commands they execute Marco> at source time is not very exciting. Nor it is trying to Marco> guess at what is the last module subdir being sourced and Marco> put in there my .tcl files. Marco> Shouldn't AS source the .tcl files after having done all of Marco> its initialization? I mean, it could first read from Marco> nsd.ini what are the modules to load (native and user Tcl Marco> pseudo-modules), then load the native modules, then source Marco> all the .tcl files - except those contained in user Tcl Marco> pseudo-modules subdirs - and finally source user Tcl Marco> pseudo-modules subdirs... This way, by placing my .tcl Marco> files in a modules/tcl/ or servers//modules/tcl/ Marco> subdir of my choice, organized as a Tcl pseudo-module, I Marco> could be sure that they are sourced last, when all the Marco> built-in commands (and even the Tcl procs coming with AS) Marco> are available. Marco> At least, is it possible to impose the module loading order Marco> by ordering the keys in section Marco> [ns/server//modules] of nsd.ini? Yes, that's the order the modules are loaded. Since modules can add commands from either the .so or their own Tcl, we believe it makes the most sense to load each module's Tcl when its .so is loaded. Marco> Another related question would be how can I impose a Marco> sourcing sequence order among my .tcl files... so that I Marco> can know whether a proc of mines, which I'm going to call Marco> from level 0 in one of my files, is available. The Tcl files are loaded in alphabetical order. doug -- ------------------------------------------------------------------- Doug McKee, Manager, Web Server Development Email: doug@aol.net America Online, Inc. Voice: (703) 918-1333 8619 Westwood Center Drive Fax: (703) 918-2710 Vienna, VA 22182 ------------------------------------------------------------------- ========================================================================= Date: Mon, 18 Aug 1997 19:48:53 +0200 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Wolfgang Bathelt Organization: TPIII Subject: TCL and HTML development environment MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit hello all, on saturday I posted a message for an enhanced TCL- and HTML- Statistics-development-tool based on Hal M.Heislers "easytcl". Today (Monday in Germany) I received a heap of e-mails due to malfunctioning of my local ftp-server. I replaced it with a different one, so the download should work. To have a look at the demo, try http://joy.tp3.ruhr-uni-bochum.de/NS/TCL or http://134.147.140.100/NS/TCL use "guest,easytcl" as the user,password combination. download: ( 2.033 and gequal-2.1 versions ) 1. ftp://134.147.140.100/pub/AOLserver/tcl 2. use the above guest login and click on the "FTP easytcl" link in the navigation window. that's it -- w. bathelt -- admin TPIII homepage: http://www.tp3.ruhr-uni-bochum.de/woba.html email: mailto:woba@dortmund.net RUB NB6/56 ph: +49-(0)234-700-3146 fax: +49(0)-234-7094-448 ========================================================================= Date: Mon, 18 Aug 1997 22:46:32 -0700 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Vojislav Lalich-Petrich Subject: ftp module Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hi, Does anyone know if there was an FTP module developed for AS 2.1 on NT? If so, where can one get it? Thanks, Voja. ========================================================================= Date: Mon, 18 Aug 1997 22:46:31 -0700 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Vojislav Lalich-Petrich Subject: thread max (700) reached Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello all, Does anyone know why is this happening and even more importantly, what can be done to make it not happen. 700 is a big number. [11/Aug/1997:12:51:34 -0500][214.220][-Scheduler-] Warning: server1: thread max (700) reached with 1 connections waiting. We use 2.1 (and Illustra), NT 4.0 on P6-200 with 128MB. Thanks, Voja. ========================================================================= Date: Mon, 18 Aug 1997 23:38:01 -0700 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Vojislav Lalich-Petrich Subject: JDBC-ODBC bridge Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello all, Here is one that might not be directly relevant but my be someone has an advice. Did anyone tried to set up one of the JDBC-ODBC bridged to be used with the ODBC driver on the Illustra (OEM version AOL was distributing in the past)? Any ideas or experiences on this will be highly appreciated. Thanks, Voja. P.S. Is there an Illustra related news group someone can point me to (outside of comp.databases.informix)? ========================================================================= Date: Tue, 19 Aug 1997 00:01:37 -0700 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Vojislav Lalich-Petrich Subject: setting MI_LOCKS in miparams file Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hi there, Back in April this issue was discussed but, to the best of my knowledge, was never resolved. It is regarding trying to explicitly set the MI_LOCKS in miparams file of Illustra DB server version 3.2 (the OEM version distributed by AOL). I'd like to see if anyone has any info on this issue and has it been resolved? Thanks a lot, Voja. -- Background of a problem -- Apparently, when MI_LOCKS is explicitly set, even to the default number of 2400, the server will not start. Basically, the problem is that, for the larger tables (1.5 mil. rows in my case) the default number of 2400 (implicitly used by the server on boot) for MI_LOCKS will not suffice and will cause server to hang. A fix I was told to use, locking on the whole table by having using (lock=table) in the SQL is starting to cause problems as I'm running into concurrency issues (more than one "person" trying to access the table at the same time). Couple of people got involved in this and suggested the issue is with the license keys that came with Illustra. At 05:42 PM 4/8/97 +0100, Frank Overton wrote: >>The daemon checks for a '00' license with the license manager for some >>reason when this parameter is set. AOLServer has licenses in the '11000' >>range and so the log in is rejected. (See MI_HOME/adm/license.log for the >>error message.) and also >>Doug at AOL says: "You don't get a 00 key with AOLserver; you get a few >>11000 keys that let AOLserver connect to the db." This is now an AOL >>specific bug in the Illustra database. Let me know if you have any idea how >>to get Illustra to fix it. I also know that Informix Case Number was issued on this matter and is: 629037. ========================================================================= Date: Tue, 19 Aug 1997 10:36:33 +0000 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Paul d'Haens Subject: Using exit() in C for a TCL command MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT I have some C code meant to be compiled as an executable. In many functions it does ERREXIT("Cannot...") ERREXIT is defined as : #define ERREXIT(msg) (fprintf(stderr, "%s\n", msg), exit(EXIT_FAILURE)) I rewrote the main function to use it as TCL command. It's working fine except when the ERREXIT is called. How can I rewrite the exit() so it gives control back to the main function that implement the TCL command and than does a return TCL_ERROR. ========================================================================= Date: Tue, 19 Aug 1997 01:06:54 -0400 Reply-To: philg@mit.edu Sender: Web Development with AOLserver From: Philip Greenspun Subject: beware of using ns_returnfile $conn 401 with msie Comments: cc: feedback@aolserver.com, doug@aol.net, kov@mitpress.mit.edu, ehling@mitpress.mit.edu I built a little AOLserver filter for MIT Press (a quality AOLserver-backed site at http://mitpress.mit.edu ). If it thought a user might be unworthy, it hammered his sorry connection with ns_returnfile $conn 401 ... This causes Netscape to prompt the user for a username/password. This causes MSIE to blow chunks. A little TELNETing to Port 80 revealed that the AOLserver proper rejected people from password-protected pages with an extra header: WWW-Authenticate: Basic realm="mitpress" ns_returnfile does not add this by default, though you can make it do so by replacing the MIME type with "text/html\nWWW-Authenticate: Basic realm=\"mitpress\"" This makes MSIE happy again. I'm not sure whether to call this an AOLserver bug or feature. I somehow think that there should be a way to win with ns_returnfile (because we want a custom page explaining to users that they have to subscribe to an MIT Press journal). Workarounds: (1) use the AOLserver API call ns_returnunauthorized which I've verified to do the right thing with the headers (but which serves the generic server-wide unauthorization page), or (2) add some headers like I showed above OR just ns_write the raw stuff. Doug: is this behavior for ns_returnfile a bug or a feature? Should it add the WWW-Authenticate header or not? Though I'm against magic behavior, I kind of think that it should because what else would be wanted? Alternatively, maybe ns_returnunauthorized should take an optional file arg. -- Philip Greenspun p.s. You all might get a kick out of http://www-swiss.ai.mit.edu/wtr/dead-trees/story.html which explains how I happened to write a book on building AOLserver-backed sites AND the humliating process of working in the computer publishing industry. ------------------------------------------------------------- MIT Department of Electrical Engineering and Computer Science 545 Technology Square, Rm 609, Cambridge, MA 02139, (617) 253-8574 Web: http://www-swiss.ai.mit.edu/philg/ ========================================================================= Date: Tue, 19 Aug 1997 19:49:02 +0200 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Marco Coletti Subject: Re: beware of using ns_returnfile $conn 401 with msie Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" At 01.06 19/08/97 -0400, Philip Greenspun wrote: >WWW-Authenticate: Basic realm="mitpress" > >ns_returnfile does not add this by default, though you can make it do so >by replacing the MIME type with > >"text/html\nWWW-Authenticate: Basic realm=\"mitpress\"" That's a dirty trick! ;-) >Workarounds: (1) use the AOLserver API call ns_returnunauthorized which >I've verified to do the right thing with the headers (but which serves >the generic server-wide unauthorization page), or (2) add some headers >like I showed above OR just ns_write the raw stuff. There is another, perhaps cleaner, solution: .................................................... #1 set headers [ns_conn outputheaders $conn] #2 set headers [ns_set new myheaders] ns_set put $headers WWW-Authenticate "Basic realm=\"mitpress\"" ns_respond $conn -status 401 -type text/html -headers $headers \ -file yourfile.html .................................................... Use #1 if ns_respond uses the -header headers as output headers. Use #2 if ns_respond adds them to the output headers. I don't know which case is right, because I haven't tested the code and the AOLserver 2.1 Tcl Developer's Guide isn't much clear about that: "ns_respond builds a complete response for the client with all of the specified information in the header." Or even better: .................................................... ns_set put [ns_conn outputheaders $conn] \ WWW-Authenticate "Basic realm=\"mitpress\"" ns_returnfile $conn 401 text/html yourfile.html .................................................... I use this regularly for the pourpose of throwing cookies at the client browser. The manual says about *ns_conn outputheaders*: "*ns_conn outputheaders* returns the set of headers that will be sent out when a result is returned to the client." It isn't clear if writing into the set of output headers is allowed, but it works. Ciao. ------------------------------------------------------------ -= MarCo =- PGP public key: http://keys.pgp.com:11371/pks/lookup?op=get&exact=on&search=0x96A79061 finger://mail.eurofin.it/marco.coletti Fingerprint: 9F E5 80 61 F6 9F 05 2D EA 53 6F 2D 82 8B C7 C2 ------------------------------------------------------------------------ ========================================================================= Date: Wed, 20 Aug 1997 08:41:44 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Mark Dalrymple Subject: Re: thread max (700) reached Comments: cc: lpv@visioninc.com Greetings, > Does anyone know why is this happening and even more importantly, what can > be done to make it not happen. 700 is a big number. > [11/Aug/1997:12:51:34 -0500][214.220][-Scheduler-] Warning: server1: > thread max (700) reached with 1 connections waiting. I know nothing about NT, but I've seen something similar on AXP/OSF1 where a signal/exception was happening during the processing of a connection (whether it be a SEGV or an unexpected signal). The thread itself would get shutdown properly (from an OS perspective), but AOLServer's count of threads wouldn't get decremented. So, we'd get reports like this, but in reality, there would only be a handful of threads that were actually there. Does NT have a system utility that lets you see the number of threads a process/team/whatever-you-call-it has? It'd be interesting to see if there were really 700 threads alive. If not, the next place to look would be to see if there are any custom extension that are crashing. On un*x, you can turn off the CatchExceptions parameter in [ns/parameters], where you should get a core dump if something Really Bad was happening. Another technique I use on the un*x side (which may or may not be applicable to the NT side) is to attach to the running AOLServer process with a debugger and wait for something to happen (a crash or a stray signal should get trapped by the debugger, and hopefully there will be a smoking gun there to give a hint on what's going on.) ++Mark Dalrymple, America Online Web Server Development. markd@aol.com "Your first book, Mysteries of the Unknown, is under the floorboards behind the refrigerator. Later books will explain how it got there" -- Drew Lawso ========================================================================= Date: Thu, 21 Aug 1997 03:39:55 +0200 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Marco Coletti Subject: ns_share vs global Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" If you use 'global' then your scripts don't work as expected on AOLserver 2.2+. You can set sharedglobals=On in the server configuration, but then you lose the new restricted significance of 'global' as "interpreter global" (I think this makes sense only in Tcl pages or ADP pages). If you use 'ns_share' then your scripts don't work at all on AOLserver < 2.2. How it is possible to mean "shared" on every AOLserver version without search/replacing over the scripts? One possible solution is to include (at level 0) the following piece of code: . at the beginning of all your scripts or . for all your Tcl only modules, at the beginning of the script which file name comes first in alphabetical order. or . at the beginning of the script which is going to be sourced first (according to Doug McKee, module order as specified in nsd.ini first, then alphabetic file name order). ..................................................... if ![info exists NS_SHARE] { set NS_SHARE global set NS(2.2+) [expr {[ns_info version] >= 2.2}] if $NS(2.2+) { set NS_SHARE ns_share } $NS_SHARE NS_SHARE } ..................................................... and then use $NS_SHARE as a command wherever you want to mean ns_share (even for AOLserver < 2.2). Plus, you can test everywhere if 2.2+ is running by if $NS(2.2+) { ... } Note: NS is already a shared array variable on every AOLserver version. ------------------------------------------------------------ -= MarCo =- PGP public key: http://keys.pgp.com:11371/pks/lookup?op=get&exact=on&search=0x96A79061 finger://mail.eurofin.it/marco.coletti Fingerprint: 9F E5 80 61 F6 9F 05 2D EA 53 6F 2D 82 8B C7 C2 ------------------------------------------------------------------------ ========================================================================= Date: Thu, 21 Aug 1997 03:56:35 +0200 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Marco Coletti Subject: ns_share vs global: NOT QUITE Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" >if ![info exists NS_SHARE] { > set NS_SHARE global > set NS(2.2+) [expr {[ns_info version] >= 2.2}] > if $NS(2.2+) { > set NS_SHARE ns_share > } > $NS_SHARE NS_SHARE >} >and then use $NS_SHARE as a command wherever you want to mean ns_share (even for AOLserver < 2.2). Oops! I made a big mistake: how is going a proc to see the variable NS_SHARE? Obviously not using: proc myproc {} { $NS_SHARE NS_SHARE } And using (AOLserver 2.2+) proc myproc {} { ns_share NS_SHARE } or (AOLserver < 2.2) proc myproc {} { global NS_SHARE } is pointless... Please, disregard my previous message and blame me for this goof... ------------------------------------------------------------ -= MarCo =- PGP public key: http://keys.pgp.com:11371/pks/lookup?op=get&exact=on&search=0x96A79061 finger://mail.eurofin.it/marco.coletti Fingerprint: 9F E5 80 61 F6 9F 05 2D EA 53 6F 2D 82 8B C7 C2 ------------------------------------------------------------------------ ========================================================================= Date: Thu, 21 Aug 1997 07:48:04 +0100 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Barlow Subject: aolserver thread max reached on NT Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello I do not know whom the original poster was with the thread max problem. I always had this problem myself on NT 3.51 workstation. It would also cause my aolserver to crash on a daily basis. I finally shut off reverse DNS name server lookups in the virtual servers and this fixed the BUG. Good luck! Sincerely Kerry & Donald Barlow&Barlow computers Servers for you. http://mntnweb.com barlow@servtech.com ========================================================================= Date: Thu, 21 Aug 1997 07:52:19 +0100 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Barlow Subject: aolserver locking up Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello I am desperate for a solution to the locking up aolserver. I have had this bug for 2 years running aolserver. every few days aolserver will simply stop accepting requests and my only option is to restart the server manually. I run on winnt 3.51 Workstation. I have reverse dns name lookup shut off to curtail that built in bug Nothing bad ever shows up in the virtual server logs or in the main log. IN addition occasionally my logs will fill with bad ascii characters, I dont know if this is related or not, but AOlserver will lockup sometimes when the logs are normal looking as well. Please please PLEASE any advice other then going to Microsoft internet explorer?? Unix is not an option I lost to much hair trying to get that operating system to run on my knees begging for help.!!! Sincerely Kerry & Donald Barlow&Barlow computers Servers for you. http://mntnweb.com barlow@servtech.com ========================================================================= Date: Thu, 21 Aug 1997 14:37:18 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Michael Jennings Subject: Re: aolserver locking up In-Reply-To: <1.5.4.32.19970821065219.00323764@pop.servtech.com>; from Barlow on Thu, Aug 21, 1997 at 07:52:19AM +0100 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Thursday, 21 August 1997, at 07:52:19 (+0100), Barlow wrote: > Hello I am desperate for a solution to the locking up aolserver. I have had > this bug for 2 years running aolserver. every few days aolserver will simply > stop accepting requests and my only option is to restart the server > manually. I run on winnt 3.51 Workstation. We run our DB server on an SGI Challenge S running IRIX 5.3, and it does the same thing. It just decides to stop closing the connections or threads, and once it reaches its max threads, it refuses to accept any more connections. As a stop-gap solution, we have a cron job that attempts to connect to it and does a kill -9 and restart on it if it can't connect. We have talked to tech support (we're a PrimeHost customer) countless times, but they continue to give us the run-around, blaming it on TCL errors (even when there aren't any) or some such nonsense. Call me crazy, but the server shouldn't die due to TCL errors, not even if you're trying to treat /dev/kmem as a TCL script. It just shouldn't happen! Maybe if enough people start complaining about this problem, something will get done. > Unix is not an option I lost to much hair trying to get that operating > system to run Our system *is* UNIX. Same problem. Michael -- "She'd still say, 'I love you' if I asked, but she never volunteers. Somehow what she never says means more than all the other words I hear." -- BlackHawk, "I Sure Can Smell the Rain" ======================================================================= Michael Jennings (KainX!mejenn01@irc.louisville.edu) TACH System Administrator http://www.spd.louisville.edu/~mejenn01/ ========================================================================= Date: Thu, 21 Aug 1997 13:06:25 -0700 Reply-To: "akhassin@am.net" Sender: Web Development with AOLserver From: Alex Khassin Organization: AM Computers Subject: Re: ns_share vs global: NOT QUITE MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I haven't tested this yet but I think this might work: Redefine the global command to check the version number and maybe the nsd.ini settings to automatically execute ns_share if 2.2+ or the real global if 2.1 or older. That way your code should be automatically portable between 2.1 and 2.2 and the global variables will be shared across interpreters in both. Of course you'd have call the original version of global under 2.2 to get 2.2-style global vars. -- ---------------------------------------------------------------- Alex Khassin AM Computers mailto:akhassin@am.net 1040-B N. Dutton Ave Voice: (800) 579-2018 Santa Rosa, CA 95401 (707) 579-2010 http://am.net ---------------------------------------------------------------- The Source for Advanced Computing Solutions ---------------------------------------------------------------- am.net = The Best Hosting Service with integrated database, secure transactions, real-time credit card processing and more ---------------------------------------------------------------- ========================================================================= Date: Fri, 22 Aug 1997 08:00:39 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Doug McKee Subject: Re: ftp module In-Reply-To: <3.0.32.19970818224103.00be7bc0@internet.visioninc.com> (message from Vojislav Lalich-Petrich on Mon, 18 Aug 1997 22:46:32 -0700) >>>>> "Voja" == Vojislav Lalich-Petrich writes: Voja> Hi, Does anyone know if there was an FTP module developed Voja> for AS 2.1 on NT? If so, where can one get it? The ftp module was not released for NT, and we don't plan to release it for NT. doug ------------------------------------------------------------------- Doug McKee, Manager, Web Server Development Email: doug@aol.net America Online, Inc. 8619 Westwood Center Drive Vienna, VA 22182 ------------------------------------------------------------------- ========================================================================= Date: Fri, 22 Aug 1997 08:03:46 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Doug McKee Subject: Re: beware of using ns_returnfile $conn 401 with msie Comments: cc: amhoward@aol.com In-Reply-To: <2.2.32.19970819174902.0069f8b4@mail.bearnet.it> (message from Marco Coletti on Tue, 19 Aug 1997 19:49:02 +0200) > Or even better: > .................................................... > ns_set put [ns_conn outputheaders $conn] \ > WWW-Authenticate "Basic realm=\"mitpress\"" > ns_returnfile $conn 401 text/html yourfile.html > .................................................... > I use this regularly for the pourpose of throwing cookies at the client browser. > The manual says about *ns_conn outputheaders*: > "*ns_conn outputheaders* returns the set of headers that will be sent out > when a result is returned to the client." > It isn't clear if writing into the set of output headers is allowed, but it > works. Not only is writing into this set allowed, that's why the command exists! We'll make it clear in the docs; thanks for pointing out the confusion. doug ------------------------------------------------------------------- Doug McKee, Manager, Web Server Development Email: doug@aol.net America Online, Inc. 8619 Westwood Center Drive Vienna, VA 22182 ------------------------------------------------------------------- ========================================================================= Date: Fri, 22 Aug 1997 09:41:33 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Doug McKee Subject: Re: ns_share vs global: NOT QUITE In-Reply-To: <01BCAE33.085E3C90.akhassin@am.net> (message from Alex Khassin on Thu, 21 Aug 1997 13:06:25 -0700) >>>>> "Alex" == Alex Khassin writes: Alex> I haven't tested this yet but I think this might work: Alex> Redefine the global command to check the version number and Alex> maybe the nsd.ini settings to automatically execute ns_share Alex> if 2.2+ or the real global if 2.1 or older. Alex> That way your code should be automatically portable between Alex> 2.1 and 2.2 and the global variables will be shared across Alex> interpreters in both. Alex> Of course you'd have call the original version of global Alex> under 2.2 to get 2.2-style global vars. Now I admit I haven't test this either, but we will be porting the Storefront application to run under 2.033, 2.1 and 2.2 in the next few weeks, and it uses global variables. But here's what we're going to try first: 1. Put this in the first file you load: if [string match "" [info commands ns_share]] { # Define ns_share to be "global" } If we can't get this to work, we'll just punt and write it in C; something like: if (strstr(Ns_InfoVersion(), "2.1") != NULL) { Tcl_CreateCommand(interp, "ns_share", GlobalCmd, NULL, NULL); } 2. ns_share all your globals at the beginning of the files that use them. For 2.1 this is harmless, and for 2.2 it's required. 3. Use ns_share everywhere where you would normally use global. If we need to actually support 2.033, we'll figure out what to do then! doug ------------------------------------------------------------------- Doug McKee, Manager, Web Server Development Email: doug@aol.net America Online, Inc. 8619 Westwood Center Drive Vienna, VA 22182 ------------------------------------------------------------------- ========================================================================= Date: Fri, 22 Aug 1997 00:45:00 -0400 Reply-To: philg@mit.edu Sender: Web Development with AOLserver From: Philip Greenspun Subject: aolserver locking up In-Reply-To: <199708220402.AAA28133@services.web.aol.com> (message from Automatic digest processor on Fri, 22 Aug 1997 00:01:56 -0400) It does suck when AOLserver locks up. However, I think the problem can be narrowed down to either Illustra or the Illustra driver. My AOLserver 2.2b4 on HP-UX can serve millions of static file and CGI hits (usually with at least 15 simultaneous threads) without crashing. But I get some hangs and crashes on my DB-backed AOLservers. Philip ========================================================================= Date: Fri, 22 Aug 1997 08:20:10 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Mark Dalrymple Subject: Re: aolserver locking up Yow - AOLServer locking up is definitely Not Good. It's a problem that we're aware of, but are having a dickens of a time trying to reproduce it. If you're on a unix box and AOLServer locks up, do a "kill -3" on the nsd process that's doing the serving (that's the one that's listed in the access log and log/nspid.xyz file) That should drop a core file that we can do a post-mortem on. As for NT, I'm not sure what to do. Do the resource monitoring tools have anything interesting in them around the same time AOLServer goes south? Perhaps we're not gracefully handling running out of something (memory, semaphores, threads, sockets...) If you have a development environment, using a debugger to see where AOLServer has stopped could prove to be interesting. It could be a dealock situation too. I know that BeOS has a nice tool that'll tell you what semaphore a particular thread is blocked on. NT may have the same thing. > blaming it on TCL errors Yeah, I don't see how TCL errors could cause the 'running out of threads' symptomology or crashes (unless we really screwed up something in the implementation of the TCL commands). Although via TCL you might be able to get the world to lock up via thread deadlock. ++Mark Dalrymple, America Online Web Server Development. markd@aol.com "I am sure you have all seen those "Raid Jackets" on the TV cop shows. The ones that say DEA, SHERIFF, POLICE, PARAMEDIC etc. Well, I want one that says SUSPECT. I will keep it in the car. Then when I drive past a cop scene, I will get out of the car, put on my SUSPECT raid jacket and stand around. I wonder what they will do when they realise, that not only do the good guys now have jackets so you can spot them, but the bad guys do too." -- Julian Macassey ========================================================================= Date: Sun, 24 Aug 1997 09:53:29 +0100 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Barlow Subject: aolserver lockups Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Regarding the locking up of aolserver on NT (and apparently all systems) In my case this locking up has been happening since day one of gnnserver version .000001 that long ago To help the developers, I do not use illustra and very minimal TCL scripting, other then what aol uses itself. I also do not have any database programs running. I do happen to have a few cgi programs, hit counter and clock as well as a perl based bulletin board. However the lockups occured before I ever had installed these on aol, so we can disregard them as being a problem. I have a few programs that monitor system process.s on NT . When aol is locked up I will show 4 threads open. This is far from the thread max limit. The only direct use of TCL I have on my system is for mail and mailing forms, however AOL will lockup when these programs have not even been used for weeks. Again debug tracing shows no problems with AOL. You should also know there are 2 entirely differant types of lockups I see on my system 1) is an easy lockup. hitting net stop aolserver and then net start aolserver will get the system running again quickly. 2nd style) Typing net stop aolserver will lockup the NT system for about 2 minutes then it will say aolserver cannot be controlled in its present state. I am forced to wait at least 2 more minutes until aolserver finally shuts down, then I can use a net start aolserver and get aol back online. Using the restart.bat command is no good in this 2nd situation. I have determined the 2nd state of lockup hardly ever occurs if I have reverse dns name lookup turned off. I would be happy to help the developers in any way to track down this long standing problem with aolserver. I currently have so few customers on my system I can shut down the system for testing ,or run my backup server computer if any testing is needed. good luck! Sincerely Kerry & Donald Barlow&Barlow computers Servers for you. http://mntnweb.com barlow@servtech.com ========================================================================= Date: Sun, 24 Aug 1997 10:09:13 +0100 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Barlow Subject: pop3 and smtp tcl program? Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello is there a TCL program that anyone has written for aol that will act as a post office for customers? with pop and smtp support? something that has an html/forms interface for customers to enter there own aliases and pop names would be great. I have been tracking down 3rd party mail programs and the prices are horrific on them all. Any advice would be greatly appreciated. Thank you Sincerely Kerry & Donald Barlow&Barlow computers Servers for you. http://mntnweb.com barlow@servtech.com ========================================================================= Date: Mon, 25 Aug 1997 00:29:37 -0400 Reply-To: philg@mit.edu Sender: Web Development with AOLserver From: Philip Greenspun Subject: fancy POP and SMTP program Comments: cc: barlow@servtech.com In-Reply-To: <199708250401.AAA12056@services.web.aol.com> (message from Automatic digest processor on Mon, 25 Aug 1997 00:00:17 -0400) Date: Sun, 24 Aug 1997 10:09:13 +0100 From: Barlow Subject: pop3 and smtp tcl program? Hello is there a TCL program that anyone has written for aol that will act as a post office for customers? with pop and smtp support? something that has an html/forms interface for customers to enter there own aliases and pop names would be great. I have been tracking down 3rd party mail programs and the prices are horrific on them all. Any advice would be greatly appreciated. I've been very happy with Post.Office (reviewed by me at http://www-swiss.ai.mit.edu/wtr/ ). It is free if you have fewer than 10 people actually accumulating mail and (I think) reasonably priced for large-ish number of users. The entire thing is configurable from a Web browser. Philip ========================================================================= Date: Mon, 25 Aug 1997 11:59:34 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Stanislav Krasilovskiy Subject: Regsub and & MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Dear fellow AOLserver fanatics, I am quite new to Tcl and AOLserver, yet my job requires me to write some scripts that would make our database accessible from the Web. The way I implement most of the DB access requires me to write HTML templates which then get filled in with values from the database by Tcl scripts. The templates are then returned to the browser with all the correct information filled in. I fill in the values from the database using "magic strings" in the HTML templates, something like "::employee_id::" which I then look for and replace with something like this: regsub -all -- "::employee_id::" $templateText [ ns_set get $rows id ] Everything *should* work fine as long as the "magic strings" in the HTML templates do not contain any characters that are not reserved for the regular expression syntax. But there is one thing that I really do not know how to handle, and since I am new to Tcl and regular expressions I really do not know if there is a way around this: whenever the string which is used to replace something contains an "&" character, the "magic string" gets inserted into the replacement string at the position of the &. regsub -all -- "::company_name::" $templateText "Ben & Jerry" becomes "Ben ::company_name:: Jerry" Is there a way to prevent that from happening besides "not using the & character"? Thank you for your help. Stan Krasilovskiy Boston University Dept. of Engineering ========================================================================= Date: Mon, 25 Aug 1997 13:29:47 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Jeff Rawlings Subject: Re: Regsub and & Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" At 11:59 AM 8/25/97 -0400, you wrote: >regsub -all -- "::employee_id::" $templateText [ ns_set get $rows id ] > >Everything *should* work fine as long as the "magic strings" in the HTML >templates do not contain any characters that are not reserved for the >regular expression syntax. But there is one thing that I really do not >know how to handle, and since I am new to Tcl and regular expressions I >really do not know if there is a way around this: whenever the string >which is used to replace something contains an "&" character, the "magic >string" gets inserted into the replacement string at the position of the >&. Stan, you happen to have run into a fairly common problem... Just about every script I write requires a fix for this. Try this: proc regsubquote {value} { regsub -all "&" $value {\\\&} value return $value } Then in your regsub command replace the third term like this: set value [ns_set get $rows id] regsub -all "::id::" $template [regsubquote $value] result Cheers, --Jeff Rawlings ========================================================================= Date: Mon, 25 Aug 1997 20:26:50 +0200 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Marco Coletti Subject: Regsub and & - SOLVED Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" At 11.59 25/08/97 -0400, you wrote: >I fill in the values from the database using "magic strings" in the HTML >templates, something like "::employee_id::" which I then look for and >replace with something like this: > >regsub -all -- "::employee_id::" $templateText [ ns_set get $rows id ] > >Everything *should* work fine as long as the "magic strings" in the HTML >templates do not contain any characters that are not reserved for the >regular expression syntax. But there is one thing that I really do not >know how to handle, and since I am new to Tcl and regular expressions I >really do not know if there is a way around this: whenever the string >which is used to replace something contains an "&" character, the "magic >string" gets inserted into the replacement string at the position of the >&. > >regsub -all -- "::company_name::" $templateText "Ben & Jerry" > >becomes > >"Ben ::company_name:: Jerry" > >Is there a way to prevent that from happening besides "not using the & >character"? The AOLserver Tcl manual does report this behaviour of regsub. As reported, there is another ten patterns which have special meaning if present in the 3rd actual parameter to regsub (subSpec): \0 \1 \2 ... \9 (the AOLserver Tcl manual is incorrect here, in that it reports those patterns as being \e0 \e1 \e2 ... \e9) Trying to avoid this behaviour for any given string leads to all sorts of bad interaction between Tcl syntax and subSpec syntax. Really! Anyway, I think now I have the solution; the following code should be self explanatory when run in /NS/EvalTcl (try it). .......................................................... proc _mc_quoteSubSpec {subspec} { regsub -all "&" $subspec {\\&} subspec regsub -all {(\\[0-9])} $subspec {\\\1} subspec return $subspec } set exp "foo(bar)" set str "What's a foobar?" set subspec {&-\0-\1-\2} regsub -all $exp $str $subspec var1 regsub -all $exp $str [_mc_quoteSubSpec $subspec] var2 format "$var1\n$var2" .......................................................... ------------------------------------------------------------ -= MarCo =- PGP public key: http://keys.pgp.com:11371/pks/lookup?op=get&exact=on&search=0x96A79061 finger://mail.eurofin.it/marco.coletti Fingerprint: 9F E5 80 61 F6 9F 05 2D EA 53 6F 2D 82 8B C7 C2 ------------------------------------------------------------------------ ========================================================================= Date: Tue, 26 Aug 1997 09:13:45 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Krish Menon Subject: List Subscribing and Unsubscribing Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello: We receive a good enough number of messages that request email address changes or list removals that I write this small reminder: In order to remove yourself from this mailing list, send an email to LISTSERV@SERVICES.WEB.AOL.COM with the following messages in the _body_: SIGNOFF AOLSERVER If you need to subscribe to the list from a different email address, you will have to do what's described above first, and then send another email to LISTSERV@SERVICES.WEB.AOL.COM from your new email address with the following message in the body: SUBSCRIBE AOLSERVER I apologise for the unrelated intrusion. Happy AOLServer Developing! Krish Krish Menon Webgnostic, Studio Araneum krish@araneum.com ========================================================================= Date: Wed, 27 Aug 1997 11:47:00 +0500 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: SuperUser Organization: Ekaterinburg telegraph Subject: Aolserver 2.2b5 on OSF3.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Dear sirs! I use aolserver v2.1on OSF3.2. When I have tried to install v2.2b5, has received the messages cannot map libpthread.so cannot map libexc.so But I do not have these libraries! What to me to do? Yours faithfully Igor A. Kornienko ========================================================================= Date: Wed, 27 Aug 1997 11:54:05 +0500 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: SuperUser Organization: Ekaterinburg telegraph Subject: Aolserver C API MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Dear sirs! Could not you prompt solution of the following problem. We within one year use as WEB server AOLserver, now version 2.1 on OSF3.2. In connection with that there are some codings of Russian characters, it would be desirable to carry out code conversion of issued files on fly. At now it is fulfilled by means of CGI script. For acceleration it would be desirable to have possibility to do it with the help C API. The task is represented so: 1 to receive request from the client on obtaining of the file, which name can look, for example, as /win/a.html, /win/cgi-bin/prog/a.html or /win/cgi-bin/prog. 2 To delete a component /win from a name of the requested file and to transmit request for standard processing to the server. 3 results issued by server to the client to recode and in names of the references on files to add /win, then result to send to the client. Could not you even in general outline solution of the given task and used functions? Beforehand is grateful Igor A. Kornienko ========================================================================= Date: Wed, 27 Aug 1997 09:52:50 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Krish Menon Subject: Re: Aolserver C API In-Reply-To: <3403CF0D.167E@etel.ru> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" At 11:54 AM 8/27/97 +0500, you wrote: Igor: From what I understand, you are looking for an API script that will redirect all requests for /win/* to /*, and then make sure all returned references are prefixed with /win. Using the C API is hardly necessary to do this; you can accomplish it with a simple Tcl function: ns_register_proc GET /win redirect_win proc redirect_win {conn ignore} { set newurl "[ns_conn location $conn]/[join \ [lrange [ns_conn urlv $conn] 1 end] /]" ns_returnredirect $conn $newurl } In order to substitute all returned references wth the /win, use the regsub command. Store the returned page in a Tcl variable, for example: $html = "all kinds of stuff" regsub -all {href=\"} $html "href=\"/win/" html Or something like that :-) My only question is: why? It seems a bit futile to send every request through this process. Krish >Dear sirs! >Could not you prompt solution of the following problem. >We within one year use as WEB server AOLserver, now version 2.1 on >OSF3.2. In connection with that there are some codings of Russian >characters, it would be desirable to carry out code conversion of issued >files on fly. At now it is fulfilled by means of CGI script. For >acceleration it would be desirable to have possibility to do it with the >help C API. The task is represented so: >1 to receive request from the client on obtaining of the file, which >name can look, for example, as /win/a.html, /win/cgi-bin/prog/a.html or >/win/cgi-bin/prog. >2 To delete a component /win from a name of the requested file and to >transmit request for standard processing to the server. >3 results issued by server to the client to recode and in names of the >references on files to add /win, then result to send to the client. > >Could not you even in general outline solution of the given task >and used functions? >Beforehand is grateful > > Igor A. Kornienko > > Krish Menon Studio Araneum krish@araneum.com ========================================================================= Date: Fri, 29 Aug 1997 11:36:01 +0000 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Paul d'Haens Subject: Postgres workarounds MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Here are some problems I experienced using the postgres RBMS together with the Database Services in the AOLserver Administration. If you have a better solution than these workarounds or experienced other problems using postgres please let me know. -------------------------------------------------------------------- The type of a oid field is recognised as and empty string iso an integer. Therefore ns_dbquotevalue in util.tcl will return something like '1234' iso 1234. I solved this by adding this line to the if condition : || $type == "" \ -------------------------------------------------------------------- For some reason the 'ns_db exec' command fails. This command is used in the 'Execute Abitrary SQL' link. I solved this by adding this checkbox to the form in gensql.tcl

Statement is DML: And then I rewote the proc nsp_sqleval a bit. set dmlflag [string length [ns_set get $form dml]] if $dmlflag { set db_error [ catch {ns_db dml $db $statement} ] } else { set db_error [ catch {set row [ns_db select $db $statement]} ] } set answer "

$statement

" if {!$db_error} { if {!$dmlflag} { set size [ns_set size $row] set nrows 1 ..... } else { append answer "Succeeded" } } else { append answer "

Failed

[ns_dberrormsg $db]" } ns_returnnotice $conn 200 "SQL Evaluation" $answer -------------------------------------------------------------------- Another problem is that ns_dberrormsg does not return a error message. "ns_pg error" does it. So I added this proc in nsdb/util.tcl proc ns_dberrormsg {db} { return [ns_pg error $db] } ------- Paul d'Haens - Cornhill Marketing Ltd Email: xenia@glo.be Tel: +32 3 6646180 Fax: 6647674 ========================================================================= Date: Fri, 29 Aug 1997 19:27:26 -0400 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Angela Howard Subject: AOLserver Version 2.2 Release! MIME-Version: 1.0 Content-Type: text/plain; charset=unknown-8bit Content-Transfer-Encoding: 8bit The AOLserver 2.2 release is now available!  Read the release notes and download it from http://www.aolserver.com/server/docs/2.2/notes.  It's got lots of great new features like AOLserver Dynamic Pages (similar to Microsoft's Active Server Pages), an nsftp module, a SOLID database driver, support for building proxies on top of AOLserver, and Tcp wrapper functions support. Beta Testers: ------------- The final release contains the following enhancements: - The new Ns_DbBouncePool C function and the new ns_db bouncepool Tcl functions cause all database handles in a pool to be marked stale. - The nsftp module can be configured to allow the use of the chmod command. - The behavior of the ns_share Tcl function has been changed so that an init script can only be used when specifying a single variable to be shared, and the init script must set the variable value. It also includes the following bug fixes: - AOLserver no longer crashes when it is rebooted with a deleted access.log directory, because it now creates a directory for the access.log if it doesn't exist.  As a bonus, the File parameter for the nslog module can now take an existing absolute or relative directory as a valid parameter value. - The ns_get_multipart_formdata Tcl function now handles uploaded files that contain an FF byte on all platforms. - The ns_conn url Tcl function now returns the correct value in nested ADPs. - NetObjects Fusion now publishes to nsftp. Coming Soon: ------------ In the upcoming weeks, we'll be providing: - A primer for using ADPs (AOLserver Dynamic Pages) - Documentation on building external database drivers - A complete v2.2 documentation set.  For now, the release notes describe all of the new v2.2 features, and the v2.1 documentation set describes everything else. - Our plans for Version 2.3! ____________________________________ Angela Howard, Sr. Technical Writer AOL Web Server Development AMHoward@aol.com or angelah@aol.net ____________________________________ ========================================================================= Date: Sat, 30 Aug 1997 16:44:28 +1200 Reply-To: Web Development with AOLserver Sender: Web Development with AOLserver From: Terry Morris Subject: LISTSERV/AOLSERVER 2.1 under Windows 95 Hi folks Has anyone set up AOLSERVER to run with LISTSERV interface using the WA.EXE cgi tool. Alias and cgi directories are set correctly. It looks straightforward for both apps, AOLSERVER cgi is set correctly and WA.EXE runs but WA.EXE can't contact the LISTSERV!!! The following output is generated by WA.EXE when running the search form: Unable to initiate communication with LISTSERV. Error code was 67 ("The network name cannot be found.") The server is probably not started, or too busy to respond. The following output is generated upon attempting to read a message: Error - cannot access archive files: The archive files could not be accessed, probably because they are being updated. Please try again in about 30 seconds, and report the problem if it persists for more than a few minutes. The file that could not be opened is: 'A\tech-rt.log9708' and the error code was 2. It looks probably like a LISTSERV problem - but its pathways/URL are set correctly, otherwise it wouldn't have created its Web files in the right place. If anyone has any ideas I would be ecstatic!! Best wishes ---> Terry