Re: [AOLSERVER] how to parse Content-Type "text/xml" form post

2010-04-07 Thread Bas Scheffers
Yes, there is something wrong with that: It's not in the documentation! :(

Not in the old-style docs anyway and the new Wiki is not responding, just 
hangs. Again :(

Bas.

On 07/04/2010, at 6:01 PM, Gustaf Neumann wrote:

> Is there something wrong with "ns_conn content" ?
> 
> Am 07.04.10 09:03, schrieb Bas Scheffers:
>> I think the question is *how* to grab the raw post data?
>> 
>> On Wednesday, April 7, 2010 4:12pm, "Gustaf Neumann"  
>> said:
>>   
>>> Grab the post data and use an xml parser to get the content
>>> There are multiple xml parsers for tcl available that you can use.
>>> I would recommend tdom, which supports among other
>>> things xpath (see http://www.tdom.org/)
>>> 
>>> -gustaf neumann
>>> 
>>> Am 07.04.10 06:40, schrieb Brad Chick:
>>> 
>>>> This should be fairly simple, but I having issues parsing a form post that 
>>>> is
>>>> of Content-Type "text/xml".
>>>> 
>>>> The methods I see to handle the form data all try to parse the body into
>>>> key/value pairs.
>>>> 
>>>> This is not what I need.
>>>> 
>>>> Rather, I just need the xml payload.
>>>> 
>>>> any help would be appreciated.
>>>> 
>>>> Thanks
>>>> 
>>>> 
>>>> --
>>>> AOLserver - http://www.aolserver.com/
>>>> 
>>>> To Remove yourself from this list, simply send an email
>>>> to   with the
>>>> body of "SIGNOFF AOLSERVER" in the email message. You can leave the 
>>>> Subject:
>>>> field of your email blank.
>>>> 
>>>>   
>>> 
>>> --
>>> AOLserver - http://www.aolserver.com/
>>> 
>>> To Remove yourself from this list, simply send an email to
>>>   with the
>>> body of "SIGNOFF AOLSERVER" in the email message. You can leave the 
>>> Subject: field
>>> of your email blank.
>>> 
>>> 
>> 
>> --
>> AOLserver - http://www.aolserver.com/
>> 
>> To Remove yourself from this list, simply send an email 
>> to  with the
>> body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
>> field of your email blank.
>>   
> 
> 
> --
> AOLserver - http://www.aolserver.com/
> 
> To Remove yourself from this list, simply send an email to 
>  with the
> body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
> field of your email blank.


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

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


Re: [AOLSERVER] how to parse Content-Type "text/xml" form post

2010-04-07 Thread Bas Scheffers
I think the question is *how* to grab the raw post data?

On Wednesday, April 7, 2010 4:12pm, "Gustaf Neumann"  
said:

> Grab the post data and use an xml parser to get the content
> There are multiple xml parsers for tcl available that you can use.
> I would recommend tdom, which supports among other
> things xpath (see http://www.tdom.org/)
> 
> -gustaf neumann
> 
> Am 07.04.10 06:40, schrieb Brad Chick:
>> This should be fairly simple, but I having issues parsing a form post that is
>> of Content-Type "text/xml".
>>
>> The methods I see to handle the form data all try to parse the body into
>> key/value pairs.
>>
>> This is not what I need.
>>
>> Rather, I just need the xml payload.
>>
>> any help would be appreciated.
>>
>> Thanks
>>
>>
>> --
>> AOLserver - http://www.aolserver.com/
>>
>> To Remove yourself from this list, simply send an email
>> to  with the
>> body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject:
>> field of your email blank.
>>
> 
> 
> --
> AOLserver - http://www.aolserver.com/
> 
> To Remove yourself from this list, simply send an email to
>  with the
> body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
> field
> of your email blank.
> 


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

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


Re: [AOLSERVER] how to parse Content-Type "text/xml" form post

2010-04-06 Thread Bas Scheffers
Well that's a good one!

As a workaround, using a temp file, would ns_writecontent work?

http://aolserver.com/docs/devel/tcl/api/conn.html#ns_writecontent

or ns_conncptofp?

Bas.

On Wednesday, April 7, 2010 2:10pm, "Brad Chick"  said:

> This should be fairly simple, but I having issues parsing a form post that is
> of Content-Type "text/xml".
> 
> The methods I see to handle the form data all try to parse the body into
> key/value pairs.
> 
> This is not what I need.
> 
> Rather, I just need the xml payload.
> 
> any help would be appreciated.
> 
> Thanks
> 
> 
> --
> AOLserver - http://www.aolserver.com/
> 
> To Remove yourself from this list, simply send an email to
>  with the
> body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
> field
> of your email blank.
> 


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

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


Re: [AOLSERVER] is it necessary

2009-11-02 Thread Bas Scheffers
On Tuesday, November 3, 2009 8:02am, "Jim Davidson"  said:
> I like this approach, doesn't need to be perfect performance (PHP
> isn't generally) but more naturally blending the AOLserver API's and
> Tcl stuff into Apache seems smart in the year 2009.
We'd also have to rename it to "Tickle on Tracks" and provide an MVC and ORM 
framework, of course!

Didn't AD do a module years ago? I don't think it was integrated beyond 
forwarding request; still requiring full, standard AOLserver configuration. Eve 
A. even keeps a copy around: 
http://www.eveandersson.com/arsdigita/acs-repository/mod_aolserver-1.1

> Question:  Does anyone (really) care about Win32 now?  Poking at the
Well, if we do the above, people might care more than ever; being able to 
develop on their Windows box (just like they do using WAMP) and deploy on Linux.

Bas.


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

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


Re: [AOLSERVER] is it necessary

2009-11-01 Thread Bas Scheffers
On Saturday, October 31, 2009 10:30pm, "Dave Bauer" 
 said:
> Of course you can say apt-get install aolserver4 already.
Of course you can, but then what? Then you still have this completely alien 
server in front of you that you will need to configure. It puts people off. 
being just another language and API an Apache environment is going to be much 
more appealing to most users.

The vast majority of people that *use* LAMP and not developers, nor have any 
heroic sysadmin skills. They just download WordPress or Drupal or Gallery, dump 
it into their page root and away they go. They may tweak a few templates with 
PHP code in them, but that's it.

That's the kind of simplicity AOLserver needs to grow. We live in an Apache 
world; if you can't beat them, join them...

Bas.


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

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


Re: [AOLSERVER] is it necessary

2009-10-30 Thread Bas Scheffers
I do this for a couple of sites, Apache's mod_proxy forwards stuff to  
AOLserver. This is mostly where we have a scarcity of IPs.


But that still means you have to jump through hoops to install it,  
learn how to run it in production, etc.


I'd love a being able to just say "apt-get install apache2-aolserver  
apache2-aolserver-postgresql".


Then have a config section in the virtual server where you define db  
pools, the location of your tcl lib directories, etc. This could be  
overridden by .htaccess files so that you may download a complete  
package (say a blog, like WordPress), dump it in the page root and  
the .htaccess would say "./tcllib" is just that and you could define  
pools (written to .htaccess) in "config.adp".


A completely independent interpreter pool would be maintained for each  
virtual server. It could even be the only "scripting module" to be  
able to run in a fully threaded Apache. (but still needs to run in a  
forking environment so it can play nice with PHP)


No, this won't be as great and efficient as AOLserver is, but it will  
be a whole lot easier for people to use and sell to fellow staff,  
management, clients, etc.


Just my thoughts on the subject! (And I do realise this is a whole lot  
of work!)


Bas.

On 28/10/2009, at 12:34 PM, Jim Davidson wrote:

With fancy switches and/or proxies like varnish can you effectively  
blend aolserver with other app servers (lamp, ruby etc) now without  
actual code changes ?   I'm wondering if folks have done that  
successfully


Jim


Sent from my iPhone

On Oct 27, 2009, at 6:55 PM, Dossy Shiobara   
wrote:



On 10/27/09 5:40 PM, Bas Scheffers wrote:
Moving AOLserver to run inside Apache as a module would be a great  
step to making it more accesible and popular.


This is the reason why I'd like to implement a module for AOLserver  
that

would enable it to run as a FastCGI application under Apache and/or
Lighttpd or any other webserver that speaks FastCGI.

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


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

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



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

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



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

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


Re: [AOLSERVER] is it necessary

2009-10-27 Thread Bas Scheffers
On Tuesday, October 27, 2009 7:55pm, "Bernd Eidenschink"  
said:
> Even using and relying on several AOL- and Naviservers for years now I cannot
> get used to the technical superiority discussions...
It is not about technical superiority. No matter how hard you try, AOLserver 
will still run rings around a front-end PHP server. So you need twice the 
hardware. Twice the hardware is twice the manufacturing, twice the power 
consumption, twice the cooling.

In short: AOLserver is better for the environment. If you run anything other 
than AOLserver, YOU HATE THE EARTH! It's why Greenpeace uses OpenACS!

Seriously though, you can make a succesful service on any platform. That 
doesn't mean the Twitter boys couldn't have saved themselves a whole lot of 
sleepness nights by going with a better architecture initially, instead of the 
hard to scale flavor of the month.

One of the most important reasons those platforms are more popular is because 
they all run in Apache and install with one tick of a box or "apt-get/yum" 
command, as well as working in large virtual hosting environment. (i.e.: cheap 
web hosts)

Moving AOLserver to run inside Apache as a module would be a great step to 
making it more accesible and popular.

Bas.


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

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


Re: [AOLSERVER] is it necessary

2009-10-26 Thread Bas Scheffers
On Tuesday, October 27, 2009 9:08am, "Jeff Rogers"  said:
> The C-python implementation has a misfeature known as the global
> interpreter lock (GIL) that presents scalability problems in a threaded
This why all of the Apache supported languages either require the pre-fork 
model where they keep one interpreter per process (like PHP) or party like it's 
1993 in a FastCGI environment like Ruby (on Rails) does. Yuk.

Tcl seems to be the only language that is thread safe and can be embedded in 
the way it is in AOLserver.

And like others have said: AOLserver actually uses a lot of the Tcl API. Most 
Tcl commands have a C equivalent that can be used outside an interpreter. With 
the few C modules I have made good use of this, using the String functions and 
not relying on things like glibc, for instance. (even glibc itself has many 
threading issues; I tried the str functions and in a high-load concurrent 
environment, they blew up and segfaulted.)

Bas.


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

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


Re: [AOLSERVER] 3 aolserver questions reagrding calender/drop down list/security

2009-09-24 Thread Bas Scheffers

On 24/09/2009, at 10:04 PM, Dino Vliet wrote:

Question 1)
I see the need to present the users of my site with a small little  
calender, when they want to input date fields in my forms. How is  
this accomplished? Do I really need javascript for this, or are  
there other possibilities, preferrably with TCL?
That'll require Javascript. There's enough examples you can just use  
from elsewhere. I minimize JS too, but this is something that can't be  
done without it.



 Question 2)
I would like to see people select their current country in a drop  
down box. Does anyone know how this is done? And where I will get  
the whole list of all countries in the world?

ISO 3166 is your friend: http://www.iso.org/iso/iso3166_en_code_lists.txt


Question 3)
If I look at my access.log file, I see a lot of strange requests  
where my server gives 404 as a response. [...] I tried googling for  
this but they are all apache related.

Yup, I just ignore them for that reason.

Who has some pointers for me regarding aolserver? What kind of  
operators should I avoid?
The two main attack vectors for any web application are: remote code  
execution and SQL injection. The first one could occur if you  
dynamically create Tcl code using values sent by a user (either as  
form data, part of the URL, part of headers, anything) and then use  
subst or eval on it. Don't do that! :) SQL injection (google it) is  
pretty much the same, except on the sql level. Always use  
ns_sqlquotevalue or a routine you create yourself to properly quote  
ANY value. Just because you are expecting a numeric value to come  
back, you can't think that you won't have to check it. You must check  
if it is a number value. ("string is integer -strict" is your friend)


Validate any user data before you try and send it to the database. If  
it's not right, throw it back at the user.


Aside from that you will of course need to good user login mechanism  
to make sure only people that are allowed to do stuff can do so.


Should I put every logic into the TCL or ADP pages (like calculating  
a price of a service or checking the availability of a service etc  
etc) or should I code as much logic into the database with stored  
procedures.
That choice is yours, people can get quite passionate about this  
subject! I only use stored procedures if it lowers the load in the  
database. If it would make the database do more work I don't because  
scaling a database is a lot harder than putting an extra web server in  
front of it. An exception might be where you have other software  
accessing the database and it makes sense to maintain the business  
logic in stored procedures instead of two pieces of client software.


Would you put smtp login credentials for a external smtp server in a  
TCL or ADP
I wouldn't have an SMTP server that requires login if I can avoid it.  
The mail server should be able to be set up to just allow mail from  
the ip or subnet of your server. But if you needed it, I would put the  
username and password in a config file.


Bas.


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

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


Re: [AOLSERVER] Aolserver as multithreaded TCL soc ket server ?

2009-08-18 Thread Bas Scheffers
As far as I am aware, the only way to do it is to implement a new socket driver 
in C.

AOLserver can certainly handle this. There used to be nsftp, which did just 
that.

Bas.

On Tuesday, August 18, 2009 10:26pm, "Nikolay Shulga" 
 said:

> 




Hello,
> 
> 
Is it possible to use Aolserver as multithreaded TCL socket server ?
> 
> 
If I connect to Aolserver using telnet , the server waits one of HTTP
comands
> from me. But it would be good to have full access to the socket
, from TCL script,
> without being obliged to send HTTP GET or other
requests.
> 
> 
ns_register_proc - unfortunately doesn't give such a possibility, I can
have
> access to the socket but only after HTTP request has been sent.
> 
> 
ns_socklistencallback - it gives full controll over the channell , but
process
> only one client at the moment. It will accept connections from
several clients,
> but will process only the first one. The others will
block untill the first one
> will disconnect.
> 
> 
Please , if anyone knows the solution for this, share it with me .
> 
> 
> 
> 
> --
> 
> 
Nikolay Shulga
> 
> Nikolay
Shulga
> IT
Support
> 
Runway International
> 
Basteja blvd.16, Riga,
LV 1050, Latvia
> 
Fax: +371 67 224 439
> 
Mob. :  +371 29 666 501
> 
[mailto:nikolay.shu...@runway.lv] nikolay.shu...@runway.lv
> 
[http://www.runway.lv/] www.runway.lv
> __
> Multi-lingual contact centre services
> for the Nordic, European, Russian
> and English speaking markets
> 
> 
> 
> 
> 
--
AOLserver - http://www.aolserver.com/
> 
To Remove yourself from this list, simply send an email to
>  with the
body of "SIGNOFF AOLSERVER" in the email
> message. You can leave the Subject: field of your email blank.


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

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


[AOLSERVER] Any AOLserver users in Auckland?

2009-05-18 Thread Bas Scheffers
G'day all,

Is anyone, or does anyone know of any AOLserver and/or Tcl developers in 
Auckland, New Zealand?

A national media company there is looking at re-using a site I developed many 
moons ago for their purposes and would be keen to have someone based there to 
consult, as I am in Adelaide. And I am trying to avoid the "I don't understand 
it so I don't want it" attitude their in-house guys may have as they are a 
Microsoft shop!

Cheers,
Bas.


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

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


Re: [AOLSERVER] Caching questions

2009-04-06 Thread Bas Scheffers
One caching solution for Java is http://www.opensymphony.com/oscache/ which 
should do the job quite nicely.

Another, of course, is to use memcached and any of the Java clients for it. 
This way you could clear the cache from AOLserver also if the content changes.

Finally, a singleton with a Hashmap could do it, but access would need to be 
synchronized, which could well give performance issues.

Hope that helps!

Bas.

On Tuesday, April 7, 2009 2:34am, "Janine Sisk"  said:

> I have a really screwy setup and am looking for some advice.
> 
> I have an AOLserver site running a not-very-recent version of OpenACS
> with a custom CMS I did not write.  It serves up a site written
> entirely in Traditional Chinese.   I also have a java servlet which
> takes a page from that site and translates it into Simplified
> Chinese.  So URLs are like this:
> 
> Traditional - http://big5.mysite.com/public/index
> Simplified - http://gb.mysite.com/gate/gb/big5.mysite.com/public/index
> 
> The latter goes to a Tomcat site which requests the specified page
> from big5.mysite.com, translates it, and returns it.
> 
> As you can imagine, this is not fast.  I'm working on convincing the
> client that what we really need to do is make a static HTML version of
> the Simplified site, which gets updated when they update content, and
> serve that directly.  Ultimately I'm pretty sure that's what we'll end
> up doing.  But first I have a tech guy on their end who thinks caching
> is the way to go, and I need to try that before they'll let me
> implement my own solution.
> 
> He thought I should just slap Apache in front of all this and use
> mod_cache, but that was a dead end.  Since Apache  doesn't actually
> serve any content in this scenario but merely hands off to Tomcat,
> there is nothing for it to cache.
> 
> I've done some googling on Tomcat and caching but there don't seem to
> be any add-ons for it.  They say it does some caching by default but
> I'm not seeing it, maybe because I'm not using any JSPs.  This is my
> first foray into Java programming so it's all new to me.
> 
> I know that some people use Squid as a caching proxy in front of
> AOLserver, but I'm not sure if that would solve my problem or not.
> 
> Any suggestions out there?
> 
> thanks,
> 
> janine
> 
> ---
> Janine Sisk
> President/CEO of furfly, LLC
> 503-693-6407
> 
> 
> --
> AOLserver - http://www.aolserver.com/
> 
> To Remove yourself from this list, simply send an email to
>  with the
> body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
> field
> of your email blank.
> 


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

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


Re: [AOLSERVER] Exec error produce error "Fatal: received fatal signal 11".

2009-03-01 Thread Bas Scheffers
On Monday, March 2, 2009 8:15am, "Alexey Pechnikov"  
said:

> I rewrite command as
> ...
> It's work but is not stable.
Using exec is generally unstable, not sure why, but it is certainly not 
recommended. I would try some other way, like ns_proxy. 
(http://panoptic.com/wiki/aolserver/Nsproxy)

 
> And this code work wrong:
> if {[file exists $tmpresname]==1} {
> ...
> We can see message in AOL log:
> File /tmp/fileiBmXN0/doc.pdf not exists
How was this file created? are all directories leading up to that file readable 
by the AOLserver process? doc.pdf is world readable, but it the "fileiBmXN0" 
directory also?

Bas.


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

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


Re: [AOLSERVER] Virtual hosting

2009-02-06 Thread Bas Scheffers
If you want to make them all run as individual processes, you can use  
Apache as proxy to them.


And of course Jeff is right about SSL - one per IP only unless you  
choose different ports. (which you don't want to as many corporate  
firewall only allow 80 and 443 traffic)


On 07/02/2009, at 10:39 AM, Janine Sisk wrote:


Hi all,

I'm considering moving from owning my own hardware to hosting  
everything with Amazon.  It has many advantages, but one huge  
drawback - each virtual server can only have one external IP address.


I've never tried to use AOLserver's virtual hosting;  at one time it  
was said to be less than reliable, and I've never revisited it.   
We've always had enough IP addresses that every site could have one  
of their very own.  But that's not going to be the case if I make  
this change;  virtual servers aren't cheap enough that I can set one  
up for every site, they're still going to have to be roommates.


So my question - what is the latest in virtual hosting?  Can I  
actually run multiple sites off of one IP address these days?  What  
about SSL?


I'm still using version 4.0.10 - haven't had any need to upgrade.  I  
can upgrade if necessary to deal with this, though I'd rather not  
introduce that variable at this particular point in time.


Thanks in advance,

janine

---
Janine Sisk
President/CEO of furfly, LLC
503-693-6407


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

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



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

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


Re: [AOLSERVER] Help to install AOL server

2008-10-21 Thread Bas Scheffers
Did you build Tcl with the --enable-threads flag? You must. That is  
what the "multiple _init" message usually indicates, that Tcl was not  
built with multithreading enabled.


Bas.

On 22/10/2008, at 5:10 AM, Thibault Fouache wrote:


Hi everyone !

I've got a problem during the Aol server installation at the gmake's  
step.

Here you can find the picture of the error.
Can somebody help me please?

Thanks in advance,

Thibault

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


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






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

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


Re: [AOLSERVER] Data "corruption" with fastpath caching

2008-08-18 Thread Bas Scheffers

On 19/08/2008, at 10:14 AM, Tom Jackson wrote:

No, fastpath is making the exact same assumptions that any archive
program would make, which is to record certain attributes at the time
something is cached and then compare them with the same attributes  
at a
Could the file name (just the name, not even the full path) not be  
added to the mix? Then using a random string as filename would make  
the problem go away, would it not?


Also, would it be possible to tell ns_returnfile to not use fastpath,  
if it is for one time use?


The alternative in this scenario would of course be to simply read the  
file and just ns_return it.


Bas.


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

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


Re: [AOLSERVER] "Fun, free applications for building personal sites."

2008-05-05 Thread Bas Scheffers

On 06/05/2008, at 11:44 AM, Tom Jackson wrote:
The main thing you need with a mashup is data. Without that, there  
is nothing

to mash.
And much of that data is in XML and tdom runs rings around any Java  
XML implementation, though not sure about the ones in PHP, Perl, etc  
which are also likely to be C based. (I am currently profiling and  
optimizing a car rentals aggregator site, which does tons of XML  
parsing and creating. Its all in Java and its not pretty; sooo slow  
and with enormous RAM requirements)


Has anyone used TclSOAP? And compared it in performance to Java SOAP  
clients?


Bas.


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

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


Re: [AOLSERVER] Tcl rounding question

2008-05-03 Thread Bas Scheffers

The plot thickens:

% format %.2f 18.0051
18.01

No ideas, though.

Bas.

On 04/05/2008, at 8:01 AM, William Scott Jordan wrote:


Hey all!

This is really more of a tcl question, but I'm hoping that someone  
on the list might have an explanation.  Why does [format %.2f  
18.005] round down to "18.00" and [format %.2f 1.415] round up to  
"1.42"?  Any guesses?  Am I missing something obvious here?


Tcl version 8.4, if it matters.

Thanks!

-William


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

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



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

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


Re: [AOLSERVER] ns_httpget and various encodings

2008-04-23 Thread Bas Scheffers
Not sure if that will help you here, but I abandoned ns_httpget in  
favor of the stock Tcl ::http package. More options, maintained,  
etc... It might already handle this correctly!


Bas.

On 24/04/2008, at 12:07 PM, Alex wrote:


Hello All

I need to pull info from several sites by e.g. using ns_httpget.
However the problem is that encodings and languages on those sites  
may vary.


I could hijack ns_httpget proc and set the encoding there (like
fconfigure $rfd -encoding "utf-8").
And probably even add a new ns_httpget parameter for encoding.

But what would be the "standard" method of choosing the encoding "on  
the fly"?

Or even better, automatically setting the encoding depending on the
headers of the returned page?

Thanks,
~ Alex.


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

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



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

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


Re: [AOLSERVER] ns_returnredirect

2008-04-22 Thread Bas Scheffers

Xavier,

Inside an ADP, you could simply use ns_adp_include. If you want to do  
it in a Tcl file/proc, you coud do:


ns_return 200 "text/html" [ns_adp_parse -file [file join [ns_info  
pageroot] "path/to/my_file.adp"]]


Hope that helps,
Bas.

On 22/04/2008, at 6:26 PM, Xavier Bourguignon wrote:


Hello all,

Is there a similar procedure to ns_returnredirect which returns an adp
file with an HTTP code of 200? For example: ns_return index.adp.

I have looked in the API, but I haven't found anything.

Would it be difficult to build such a procedure?

I already know about ns_return 200 "text/html" "html I want to
return", but I would love to be able to pass a file name and not have
to pass the HTML in a string.

I use singlescript = 1 in my configuration file, just in case this
makes a difference in your potential answer.

Thank you

--
Xavier Bourguignon


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

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



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

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


Re: [AOLSERVER] tcl variables

2008-04-20 Thread Bas Scheffers

On 20/04/2008, at 7:18 PM, Xavier Bourguignon wrote:

So Bob, what is the difference between setting the variable within the
adp and setting it in a procedure? Surely the variable set in the
procedure should be available as the procedure is called within the
adp.
It's all about scope! A variable declared inside a procedure is only  
available to that procedure, unless you alter the scope using global,  
upvar or uplevel.


More information on scope here: http://wiki.tcl.tk/11921

In general, creating variables inside a procedure and then using  
global or upvar/uplevel to make them available once the procedure  
returns is pretty bad form.


I would recommend you use the return value of the proc for the value  
you want in your ADP, like:


<%
proc foo {} {
return "bar"
}

set value [foo]
%>
<%= $value %>

You should also consider having procedure creating parts of your HTML,  
which can be made easy using subst:


<%
proc createBox {title contents} {
return [subst {
$title
$contents
}]
}
%>
<%= [createBox "It's all about scope" "blah blah blah" ] %>

The use of subst here makes it possible to not escape the " character  
and still have the variables included.


While I do not use a templating system, virtually all my HTML is  
created using procedures like the one above that I put in Tcl libraries.


And all of the data from the database I get using other procedures  
that only select from the database and put it in a structure I can  
pass into one of the HTML procedures. My ADP pages usually have not  
much more than 10 to 20 lines in them; it makes everything easy to  
maintain and bug-free and re-using html and logic throughout the site  
is very easy.


Hope that gives you some inspiration!

Bas.


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

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


[AOLSERVER] SQL smuggling not a bug, it's a feature!

2008-04-17 Thread Bas Scheffers

Given our current conversations, I can't help not to share this:

http://thedailywtf.com/Articles/Oklahoma-Leaks-Tens-of-Thousands-of-Social-Security-Numbers,-Other-Sensitive-Data.aspx


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

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


[AOLSERVER] Postgres stored procedure performance

2008-04-17 Thread Bas Scheffers
This is by no means the world's best test (that would be re-writing an  
actual heavily loaded application), but I tried the same query as I  
did in Java yesterday in libpq.


Single threaded, the results were similar, seeing a 6.2% improvement  
this time. But when I started running several process concurrently (a  
shell script running starting the process 10 times in the background)  
the advantage of the prepared statement fell back to just a 2.5%  
improvement.


The execution times were nearly identical between the Java and C code  
(MacBook Pro 2.2Ghz, Postgres 8.2) with both doing 160 queries per  
second. The C code running concurrent connections went to 260/sec -  
which makes sense as the second core came into play. This postgres is  
used for development only and has had no tuning whatsoever, just out  
of the box.


So probably not worth the effort as much as I had hoped, but there is  
one interesting outcome:


JDBC does exactly what most people do not want to do for AOLserver and  
that is having the same bind variables / query parameters interface  
for each and every database, implemented in the driver. Even so, the  
performance between this and the libpq code is virtually the same. So  
whatever objection people might have regarding a single way to use  
bind variables in nsdb, performance should not be one of them.


Even though it is not my favourite way of doing it, two drivers  
(Postgres and Oracle) already have the same bind variable syntax, with  
the Oracle one following the native method and Postgres emulating it.  
So how about we forget prepared statements for now and at least make  
bind variables standard in nsdb, using the syntax used by Oracle and  
Postgres?


Cheers,
Bas.


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

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


Re: [AOLSERVER] ns_db and bind variable support

2008-04-16 Thread Bas Scheffers

On 17/04/2008, at 1:18 PM, Jeff Rogers wrote:

Do you have test code and results to back this up?
I though I would give it a go. It is not the same, but I used Java  
because it is so easy to use prepared statements. I took the  
"dellstore2" database from the postgres sample database project and  
did a relatively simple query on a small data set:


select *
from customers c
join orders o on o.customerid = c.customerid
join orderlines l on o.orderid = l.orderid
where c.customerid = ?

1000 invocation with a random customerid between 0 and 20,000. (single  
connection and thread) Obviously I ran these several times each and  
took the average execution time. This to avoid the situation where the  
computer was doing something else during one of the runs influencing  
the results.


The prepared version gained 6.7% in performance.

Unfortunately, this only proves that this Java sample is faster using  
prepared statements, not where those gains are made. I find it safe to  
assume at least some of those gains are from Postgres, probably making  
it worth creating at least a prototype for it in AOLserver where it  
will also be easy to put a load tester against it and see what the  
gains are in a real (multithreaded) situation.


Hmmm, come to think of it, I can do this test natively in libpq. I'll  
try and do that soon.


Bas.


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

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


Re: [AOLSERVER] aolserver and Pgtcl

2008-04-16 Thread Bas Scheffers

Uhm, yes, possible. :)

On 17/04/2008, at 12:54 PM, Michael A. Cleverly wrote:
On Wed, Apr 16, 2008 at 5:20 PM, Bas Scheffers <[EMAIL PROTECTED]>  
wrote:

On 17/04/2008, at 8:14 AM, Dossy Shiobara wrote:

I don't really like bind variables, I would much rather see it  
implemented

like:

ns_db select $db "select * from people where country = $1 and age >  
$2"

[list "au" 25]


You mean:

   ns_db select $db {select * from people where country = $1 and age

$2} [list "au" 25]


I presume.


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

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



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

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


Re: [AOLSERVER] ns_db and bind variable support

2008-04-16 Thread Bas Scheffers

On 17/04/2008, at 11:30 AM, Dossy Shiobara wrote:
In web applications, one of the big performance hits is SQL query  
parse

time.


But the problem is creating a cache that knows which connections from  
the pool already have the statement cached and the ID that goes with  
it. This why few, including myself, use it - the only logical way is  
to handle this at the driver level, not the application code level.  
(although in the API there will be ways to control the caching  
behavior, obviously)



   set stmt [ns_db prepare ?-pool $pool | -handle $handle? $sql]
I would say this needs to be at the handle level. It needs to be  
compiled per connection anyway and if you run your web application  
long enough, each handle will eventually have every statement cached.  
You could add a -name flag where the developer could name the query  
themselves.


to "know" this)--so, caching/reuse of prepared statements really  
should
be left up to the application code, as the developer ought to know  
when

it can be reused vs. when it should be flushed/re-prepared.
My though on this is that you need to prepare the statement against a  
handle as a prepared statement is valid per connection anyway. If the  
developer passes the -cache flag, it will be cached by name/hash, in  
an ns_set in connection pool entry. This can be done by either a  
provided name or a hash.


If you pass the cache flag, it will look up if for that connection a  
prepared version already exist and then either create or re-use it. It  
returns the statement name/id for use in "ns_db exec|select|dml - 
statement".


Of you omnit the cache flag, a new one will be created with a unique  
name and can be re-used until the connection is passed back to the  
pool, at which time it will be deallocated.


One thing to keep in mind is that the query will be planned when  
prepared. But as a table grows, the strategy might change and a re- 
compile is needed. A limited TTL on any connection, configurable in  
the pool config, should do the trick.


If we solve the caching problem and people re-code their apps, I would  
not be surprised if there will be a good performance improvement.  
Heck, it could be the biggest performance boost in AOLserver in years!


Bas.


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

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


Re: [AOLSERVER] aolserver and Pgtcl

2008-04-16 Thread Bas Scheffers
It is the obvious way to do it. I would suspect that the OpenACS team  
decided to mimic Oracle behavior simply to lower the amount of re- 
writing of existing queries to be done. Which is perfectly valid for  
their goal and how I would likely have done it. However, to implement  
this in ns_db, there is no good reason to make it work the same way as  
Oracle does unless it is decided we want it to work the same for every  
database and this is the chosen syntax.


Bas.

On 17/04/2008, at 12:32 PM, Brett Schwarz wrote:

This is how pgtcl actually does bind variables...

- Original Message 
From: Bas Scheffers <[EMAIL PROTECTED]>
To: AOLSERVER@LISTSERV.AOL.COM
Sent: Wednesday, April 16, 2008 4:20:46 PM
Subject: Re: [AOLSERVER] aolserver and Pgtcl

On 17/04/2008, at 8:14 AM, Dossy Shiobara wrote:

I have wanted to add bind variable support to nsdb for a _long_ time,
but never got around to computing this support matrix that I describe
above.

I don't really like bind variables, I would much rather see it
implemented like:

ns_db select $db "select * from people where country = $1 and age >
$2" [list "au" 25]

The api could even fall back to emulating this when the database
itself does not support it.

This would be in a database independent way, instead of the current
way with Postgres and Oracle implementing their own commands.

Bas.


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

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






  


Be a better friend, newshound, and
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


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

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



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

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


Re: [AOLSERVER] ns_db and bind variable support

2008-04-16 Thread Bas Scheffers

On 17/04/2008, at 9:36 AM, Andrew Piskorski wrote:


bind variables in higher level code.  This means that the various ns*
database drivers MUST be involved in proper AOLserver bind variable
support.  Now, ns_db certainly can and should provide the various
Absolutely, the emulation I suggested would only come into play if the  
underlying driver does not itself implement the correct functions  
needed for allowing bind variables.



calls, which hook into the driver-specific code underneath, rather
than just punting completely and letting the user call driver-provided
Tcl commands directly like it does now.
Yup, that is what I would like to get rid of. ns_pg_exec is not  
something I would like to use. I'd like to think we are above the PHP- 
esque pg_connect/my_connect/pg_exec/etc!



passed allong to the proper database driver.  Therefore, the right
default approach for ns_db bind variable support is to transparently
pass through whatever bind variable syntax and usage each database and
its driver natively supports and expects.
Ah, but which is the driver, libpq or nspostgres? If comparing to JDBC  
and the various .NET schemes, it would be the latter, allowing for a  
single syntax across all databases. But it would be up to the  
individual drivers to comply with this standard, not for nsdb to  
emulate it.


To be honest, I am not a "database switcher" and don't really care all  
that much about being completely db independent. That said, in any  
case I would like to get rid of ns_pg_exec and make any command that  
uses bind variables or parameters (the more correct term when looking  
at libpq) a standard nsdb command.


So for Postgres that would be $1, $2, etc and extra parameters to the  
ns_db function after the SQL, for Oracle this might be using the Tcl  
variables if that is how it natively does it. (the OACS pg driver is  
already emulating Oracle, not working the way libpq does it natively)   
MySQL I believe only supports parameters when using prepared statements.


That brings me to another subject: do we want prepared statements? I  
use them all the time in JDBC, but that is simply because it is the  
only way add variables; I rarely re-use them unless it is some bulk  
data loader I am implementing.


Bas.


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

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


Re: [AOLSERVER] aolserver and Pgtcl

2008-04-16 Thread Bas Scheffers

On 17/04/2008, at 9:10 AM, Don Baccus wrote:
ns_db select $db "select * from people where country = $1 and age >  
$2" [list "au" 25]

Geez, names are more readable than numbers in any sizable query.
The numbers/names isn't that important to me. What is important is  
that I would like to see variables explicitly attached to the query  
rather than simply saying: "use this existing Tcl variable."


nspostgres supports the optional passing of an ns_set to define the  
bind vars

How does this work, do you have an example?

And before answering "well, they can always use the variable  
directly" remember that both emulated and real bind vars give  
protect against sql smuggling.
I would never say that; not having to worry about quoting is one of  
the main advantages of using bind variables/parameters.


Bas.


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

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


Re: [AOLSERVER] aolserver and Pgtcl

2008-04-16 Thread Bas Scheffers

On 17/04/2008, at 9:25 AM, Tom Jackson wrote:

Your script/page level code can remain unchanged even when you switch
databases.
That looks more like an OR mapping framework. I think that is a good  
thing to have also but to me it is separate from having bind variables  
in the core nsdb api. I would expect any OR mapping tool to build on  
it, rather than emulate it.


Bas.


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

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


Re: [AOLSERVER] aolserver and Pgtcl

2008-04-16 Thread Bas Scheffers

On 17/04/2008, at 8:14 AM, Dossy Shiobara wrote:

I have wanted to add bind variable support to nsdb for a _long_ time,
but never got around to computing this support matrix that I describe
above.
I don't really like bind variables, I would much rather see it  
implemented like:


ns_db select $db "select * from people where country = $1 and age >  
$2" [list "au" 25]


The api could even fall back to emulating this when the database  
itself does not support it.


This would be in a database independent way, instead of the current  
way with Postgres and Oracle implementing their own commands.


Bas.


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

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


Re: [AOLSERVER] ns_db and multibyte support

2008-04-03 Thread Bas Scheffers

On 04/04/2008, at 8:44 AM, Cynthia Kiser wrote:
It never occurred to me to try parsing this with Tcl instead. Is  
there an AOLserver or straight Tcl module I should be using to parse  
pseudo-CSV? Or is the answer keep it simple and just read lines and  
split on ¡ with 'split'?
Tcl lib has a CSV parser: http://tcllib.sourceforge.net/doc/csv.html.  
But if the text doesn't contain that character elsewhere and no  
quoting for values is used, split might work just fine. I was dealing  
with something exported out of Excel, so if a value contained commas,  
it would wrap the thing in quotes. Hence a complete CSV implementation  
was easiest.


To make absolutely, 100% sure you have the correct character to  
separate on, you could edit the file to just contain that one and read  
it in.


Bas.


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

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


Re: [AOLSERVER] weird behaviour with time

2008-04-03 Thread Bas Scheffers

Can you show the code on how you are setting the cookie?

Setting a time using the old style netscape cookie spec is entirely  
unreliable as it depends on the client's computer clock being accurate.


I don't find timed cookies very useful in any case and only ever use  
no time-out (i.e.: expires when browser closes) or time-out way out  
into the future. (many years)


Regards,
Bas.



On 04/04/2008, at 4:58 AM, Xavier Bourguignon wrote:

Ok, this may not be an aolserver problem, but maybe an OS problem, but
at the moment, when I set a cookie, I set it to live for 1 minute
only.

Now here is the problem.

If I look at my cookie in firefox, it says that cookie will expire in
1 hour and not 1 minute.

I have checked the datettime on the machine, I types date '+%s' at the
bash prompt and I get the number of seconds since epoch which matches
well with ns_time and the number I use to set the cookie.

What could be wrong, why is it that all of a sudden, my cookie lasts 1
hour instead of 1 minute?

I have checked the maths and everything is fine.

Thanks


--
Xavier Bourguignon


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

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



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

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


Re: [AOLSERVER] ns_db and multibyte support

2008-04-02 Thread Bas Scheffers

My own special recipe is to not worry about it! :)

If you have a green-fields project with no existing database, all you  
do is:


- Make sure the database is UTF-8
- Set the encoding to UTF-8 for any page returned to the client. (if  
you have a form on a page and the page was set to UTF-8, the data is  
submitted as UTF-8 by the browser, so no conversion needed by you)
- Make sure any files (ADP, resource files with messages, etc) are  
saved as UTF-8 if they contain such data.


It then basically takes care of itself.

The only issues I ever faced was (CSV) file uploads, where the data  
needed to be extracted and put into the database. This could contain  
any encoding without me knowing. In practice it only ever contained  
stupid Windows encoding, so I assumed that to be the case and used  
Tcl's convert functions.


Bas.

On 03/04/2008, at 9:25 AM, Tom Jackson wrote:

Just to back up what Bas said, AOLserver has been, and probably  
still is,

light years ahead of most systems when handling encoding issues.

Tcl is essentially UTF-8, which is multi-byte. But there are so many  
issues
involved, you have to become something of an expert. The good news  
is that

AOLserver/Tcl has the tools to handle the issues.

tom jackson


On Wednesday 02 April 2008 15:38, Bas Scheffers wrote:

Some questions to help us, and maybe give you some hints as to what
might be wrong.

How did you determine the fact that the value isn't a correct Tcl
string?

What encoding is the database in? (UTF-8?) Are you 100% sure the data
in the database is actually correct?

I wouldn't think you would need to convert anything. Tcl uses UTF-8
internally. A string from the database should be nothing more than an
array of bytes and when a Tcl string is created, it is assumed these
bytes are UTF-8.

Did you specify the correct encoding in either the server headers
(preferred) or html tags? Unless you do that, the browser won't know
what character set it should use.

Regards,
Bas.

On 03/04/2008, at 4:52 AM, Rajesh nair wrote:

Hi all,

We have an existing Tcl service which provides the data from mysql
to clients as an HTML table.
We have some records in mysql with multibye characters which are not
being rendered correctly.

Simple ns_db getrow does not return me the correctly encoded data
form database.
I have the sample code snippet to replicate this

  set db [ns_db gethandle]

  set sql1 "use mydb";
  ns_db exec $db $sql1;
set row [ns_db select $db "select title from channel"]
  set numcols [ns_set size $row]
  while {[ns_db getrow $db $row]} {
 for {set i 0} {$i < $numcols} {incr i} {
ns_puts " :[ns_set value $row $i]"
}
ns_puts ""}

I understand that I need to specify the encoding to get the correct
tcl strings in ns_set but cannot find the way to do so. Any  
pointers?


Thanks in advance--
-- Rajesh Nair


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

To Remove yourself from this list, simply send an email to
<[EMAIL PROTECTED]


with the


body of "SIGNOFF AOLSERVER" in the email message. You can leave the
Subject: field of your email blank.


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

To Remove yourself from this list, simply send an email to
<[EMAIL PROTECTED]> with the body of "SIGNOFF AOLSERVER" in  
the

email message. You can leave the Subject: field of your email blank.



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

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



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

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


Re: [AOLSERVER] ns_db and multibyte support

2008-04-02 Thread Bas Scheffers
Some questions to help us, and maybe give you some hints as to what  
might be wrong.


How did you determine the fact that the value isn't a correct Tcl  
string?


What encoding is the database in? (UTF-8?) Are you 100% sure the data  
in the database is actually correct?


I wouldn't think you would need to convert anything. Tcl uses UTF-8  
internally. A string from the database should be nothing more than an  
array of bytes and when a Tcl string is created, it is assumed these  
bytes are UTF-8.


Did you specify the correct encoding in either the server headers  
(preferred) or html tags? Unless you do that, the browser won't know  
what character set it should use.


Regards,
Bas.

On 03/04/2008, at 4:52 AM, Rajesh nair wrote:


Hi all,

We have an existing Tcl service which provides the data from mysql  
to clients as an HTML table.
We have some records in mysql with multibye characters which are not  
being rendered correctly.


Simple ns_db getrow does not return me the correctly encoded data  
form database.

I have the sample code snippet to replicate this

   set db [ns_db gethandle]

   set sql1 "use mydb";
   ns_db exec $db $sql1;
 set row [ns_db select $db "select title from channel"]
   set numcols [ns_set size $row]
   while {[ns_db getrow $db $row]} {
  for {set i 0} {$i < $numcols} {incr i} {
 ns_puts " :[ns_set value $row $i]"
 }
 ns_puts ""}

I understand that I need to specify the encoding to get the correct  
tcl strings in ns_set but cannot find the way to do so. Any pointers?


Thanks in advance--
-- Rajesh Nair


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

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



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

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


Re: [AOLSERVER] ns_db problem

2008-04-01 Thread Bas Scheffers

How are db.tcl and admin.tcl called?

The normal way of using ns_db is simply to get a handle in the page  
(ADP, Tcl or registered proc) that you need it on. Not in some other  
file like your "db.tcl".


Bas.

On 02/04/2008, at 7:51 AM, Xavier Bourguignon wrote:


Hi all,

I have this in my config file:
ns_section "ns/server/games-admin/modules"
   ns_param nssock $bindir/nssock.so
   ns_param nslog $bindir/nslog.so
   ns_param nscp $bindir/nscp.so
   ns_param nsdb $bindir/nsdb.so
   ns_param shared_tcl tcl

ns_section "ns/db/drivers"
   ns_param postgres nspostgres.so

ns_section "ns/db/pools"
   ns_param gameskillspool "Postgres"

ns_section "ns/db/pool/gamespool"
   ns_param Driver postgres
   ns_param Connections 5
   ns_param DataSource localhost::games
   ns_param User postgres
   ns_param Password "secret"
   ns_param Verbose On
   ns_param LogSQLErrors On
   ns_param ExtendedTableInfo On
   ns_param Connection 5

ns_section "ns/server/games-admin/db"
   ns_param Pools *

I have the following in my db.tcl file:
set db   [ns_db gethandle  "gamespool"]
set datasource [ns_db datasource $db]
set dbtype[ns_db dbtype $db]
set driver  [ns_db driver $db]
set poolname   [ns_db poolname   $db]
set user[ns_db user   $db]
set password[ns_db password   $db]

In file admin_op.tcl I do this:
set row [ns_db select $db "select * from tadminoptype;"]
while { [ns_db getrow $db $row] } {
ns_log Notice "[ns_set get $row type] - [ns_set get $row desc]"
}

The problem is that the code in admin_op does not work, I get this  
error:

can't read "db": no such variable
   while executing
"ns_db select $db "select * from tadminoptype;""

But if I put this code in the db.tcl file, then it works fine.

Can someone tell me if some settings are wrong, or if I am using ns_db
incorrectly?

Thank you

--
Xavier Bourguignon


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

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



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

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


Re: [AOLSERVER] globals

2008-03-19 Thread Bas Scheffers
You can use nsv shared variables, which makes the variable shared by  
all threads. You can initialize these values in a library Tcl file,  
like init.tcl.


See: http://panoptic.com/wiki/aolserver/Thread-shared_Variables

A second (and possibly better) way is to set these values in a section  
of your config file (nsd.tcl). You can then access them using the  
ns_config command.


Bas.

On 20/03/2008, at 8:51 AM, Xavier Bourguignon wrote:


Hi,

Is there a way to set a global which stays in memory for the life of
the server and not just for the life of a request?

I am asking this because I want to set some server wide configuration
items and I do this at the moment:

global CFG

set CFG(ITEM_1) val_1
set CFG(ITEM_2) val_2

But unfortunately, it seems that this global does not stay in memory
for any longer than the life of 1 request.

Thank you

--
Xavier Bourguignon


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

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



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

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


Re: [AOLSERVER] using variable in adp file

2008-03-16 Thread Bas Scheffers
Well, this should work. Normally, anything between <% %> is executed  
in the global scope and as $REQ is in the global scope it should be  
accessible.


I noticed you are using the new parser that allows you to do "... { %>  
some html <% } ...", something I have never done. Could it be this  
works differently and every block is executed in a different scope?  
(i.e.: parsed into a proc and then executed)


Bas.

On 16/03/2008, at 8:32 PM, Xavier Bourguignon wrote:


Bas, i forgot to attach my code, here is the procedure, it is called
at the beginning of every request.

proc ::gs_admin::req_init {conn arg why} {
variable INIT
global REQ

catch {unset REQ}

if {!$INIT} {
ns_log Waning "==>::gs_admin::req_init - gs_admin must be
initialised before use..."
return
}

ns_log Notice "==>Starting request"

# check the user is logged in
set logged_in [::gs_login::logged_in $conn]

if {[lindex $logged_in 0]} {
set REQ(LOGIN_OK) 1
} else {
set REQ(LOGIN_OK) 0
set REQ(LOGIN_REASON) [lindex $logged_in 1]
}

# everything is fine, lets carry on
return "filter_ok"
}

what happend now is that in my adp file I call: <% if  
{$REQ(LOGIN_OK)} { %>

and I get this error:
can't read "REQ(LOGIN_OK)": no such variable
   while executing
"if {$REQ(LOGIN_OK)} {

Very weird indeed.

Is there a way to find out which scope the code is in at any one point
in the execution?

Thank you

On 16/03/2008, Xavier Bourguignon <[EMAIL PROTECTED]> wrote:

Thanks for the answer Bas.

I have done this now: set ::variablename value

in adp: if {$::variablename} {
  blah
}

so it works now, but I have no idea as to why I should explicitly add
the :: for this to work. The tcl code runs in a function which has
been registered like this: ns_register_filter postauth.

Thank you


On 16/03/2008, Bas Scheffers <[EMAIL PROTECTED]> wrote:

The correct way to just access a variable is:

<%= $variable %>

No need for "puts". This works also:

<%= [clock seconds] %>

Which puts the output of that command in the HTML.

But it sounds like you have a scope problem. Any way you can post  
your

actual code?

If you set the variable inside a procedure, you could use "upvar" to
make it available in the scope where you want to display it. If you
put a variable in the global scope, you can access it like so:

<%= $::variable %>

Bas.


On 16/03/2008, at 8:40 AM, Xavier Bourguignon wrote:


Hi,

I have a variable set in my tcl code. e.g: set uname "myuname"

how do I use this in my adp page?. e.g: Your username is: <%puts
$uname%>

It does not seem to work, everytime i get a tcl error saying that
uname does not exists. I tried to make uname global, to no avail.

Thank you

--
Xavier Bourguignon





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

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]

with the

body of "SIGNOFF AOLSERVER" in the email message. You can leave the
Subject: field of your email blank.




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

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






--

Xavier Bourguignon




--
Xavier Bourguignon


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

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



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

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


Re: [AOLSERVER] using variable in adp file

2008-03-15 Thread Bas Scheffers

The correct way to just access a variable is:

<%= $variable %>

No need for "puts". This works also:

<%= [clock seconds] %>

Which puts the output of that command in the HTML.

But it sounds like you have a scope problem. Any way you can post your  
actual code?


If you set the variable inside a procedure, you could use "upvar" to  
make it available in the scope where you want to display it. If you  
put a variable in the global scope, you can access it like so:


<%= $::variable %>

Bas.

On 16/03/2008, at 8:40 AM, Xavier Bourguignon wrote:


Hi,

I have a variable set in my tcl code. e.g: set uname "myuname"

how do I use this in my adp page?. e.g: Your username is: <%puts  
$uname%>


It does not seem to work, everytime i get a tcl error saying that
uname does not exists. I tried to make uname global, to no avail.

Thank you

--
Xavier Bourguignon


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

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



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

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


Re: [AOLSERVER] ns_db sp_* API not working with MS SQL server 2005

2007-12-18 Thread Bas Scheffers

On 19/12/2007, at 12:59 AM, Rajesh nair wrote:
This code crashes when I do a ns_db select with SQL = “Exec procedure> @params”.
Crash is such a harsh word, don't you mean "throws an error"? I bet  
the error is "... is not a statement returning rows" or similar.



I can do a ns_db exec “exec  @param=value”.
But don’t know how to get the value returned from stored procedure  
in that case.

Try this:

ns_db 1row $db "
declare @foo int
declare @bar int
exec my_stored_proc @[EMAIL PROTECTED], @[EMAIL PROTECTED] OUTPUT
select @bar as bar
"

Now you should get back one row with the output of the procedure in  
the column "bar".


I am pretty sure this works in Sybase - I used this years ago. Not  
sure about the ODBC driver and SQL2005, though.


2. Does that mean ns_db sp_start API (and all the rest of the ns_db  
sp_* APIs will not work for MS SQL Server 2005).

Never tried that, so I wouldn't know.

Hope that helps,
Bas.


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

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


Re: [AOLSERVER] ns_db sp_* API not working with MS SQL server 2005

2007-12-17 Thread Bas Scheffers
I don't know the ns_db sp_* functions, but you can get return values  
in other ways.


First of all, there is nothing stopping you from executing a big chunk  
of T-SQL in "ns_db select". You could easily execute the stored proc  
using exec and the trick to getting the output values is to not use  
output variables, but simply using "select". If the last statement in  
your proc is a select, you will get those rows returned. But they  
don't need to be from a table, you could also do "select @varA as foo,  
@varB as bar".


And if you don't want to write your procs that way, you can just use  
execute a chunk of T-SQL which declares the output variables and then  
at then end of your "ns_db select $db "..."" block use the "select  
@varA as ..." trick again.


Bas.

On 17/12/2007, at 10:30 PM, Rajesh Nair wrote:


Hi,

I am trying to use the ns_db sp_* API in AOLServer 4.0 with  
nsfreetds driver

 against MS SQL Server 2005.
I can tell that the driver are all set fine as I can execute Select  
SQLs

correctly from ADP

But I am unable to call a stored procedure passing in a paramater and
retrieveing the result from the stored procedure.

myproc is a simple stored procedure which accepts a varchar  
parameter and

insert the parameter in a table.

Here is the simple code snippet

   <%
   if {[catch {
#Select the database
set db [ns_db gethandle];
set sql1 "use rajesh";

#ns_db sp_start
set ret1 [ns_db sp_start $db "myproc"];

#Set an input varchar parameter to the stored procedure
#This code generates error
set ret2 [ns_db sp_setparam $db "@param" varchar in "980"];
ns_puts "ret2:$ret2";

#Execute the stored procedure
set ret3 [ns_db sp_exec $db ];
ns_puts "ret3:$ret3\n  ";
} exception] != 0 } {
   global errorInfo;
   set savedInfo $errorInfo;
   ns_puts " EXCEPTION GENERATED $exception"
   ns_puts " EXCEPTION GENERATED $savedInfo "
   }


   %>


When I run this adp, I get the following error

EXCEPTION GENRATED
Database operation "sp_setparam" failed


EXCEPTION GENRATED
Database operation "sp_setparam" failed while executing "ns_db  
sp_setparam

$db "@param" varchar in "980""


I had expected the ns_db sp_setparam to be the API used to set in  
and out

parameters for Stored procedures but it is not working as such for me
Is it that I have missed anything or my expectation is wrong?

Any alternate way of doing this?
I did find that I was able to execute a stored procedure via

ns_db exec $dbhandle "exec myproc @param='980'"

but in this case I am unable to get the return value from the stored  
procedure.


Also not sure if this is the right way to execute a stored procedure  
as this

is very much db specific

--Rajesh Nair


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

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



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

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


Re: [AOLSERVER] About memcached

2007-12-17 Thread Bas Scheffers

On 18/12/2007, at 1:11 AM, Andrew Piskorski wrote:

1. Vlad's nsmemcache first.
Glancing through the code, it looks like quite a good implementation  
and very clean/readable. (i.e.: easy to improve upon further) My  
preference would also be to have a 100% AOLserver module; the socket  
API is just so nice.



2. Write my a Tcl interface to apr_memcache or whatever other existing
  C code API looks good.
That has the advantage of having a mature advanced library (dynamic  
server add/remove, pooling) but the good ones all seem to use more  
external dependencies that I'd like.



3. Finally, if I wasn't happy with any of those, implement the
  memcache protocol myself from scratch, in Tcl and/or C.
The only downside I see to Tcl is that it is hard (impossible?) to do  
pooling, creating more network overhead on both the client and the  
memcached. C will probably be the best bet.


So my preference would be Vlad's module too right now. In fact, I'll  
probably have a play with it soon as I do have an actual use for it  
myself now.


Cheers,
Bas.


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

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


Re: [AOLSERVER] How can I dynamically serve .js .css and images?

2007-11-17 Thread Bas Scheffers
If you are serving these verbatim from the database with no other  
processing, I think you should consider caching them in the file  
system for much better performance.


You can do this by creating a 404 handler that checks if the requested  
file could be got from the database. If it can, it writes it to the  
pageroot and returns it. The next time someone requests it, AOLserver  
will serve it straight from the file system.


If you upload a new version of the file to the database, that proc  
should then simply delete the existing file from the pageroot.


Here's an example:

http://panoptic.com/wiki/aolserver/AOLserver_Cookbook#Fast_caching_of_generated_pages

Regards,
Bas.

On 18/11/2007, at 9:07 AM, J. Greg Davidson wrote:


What is the best way to serve script (*.js and *.css)
and image (*.png and *.svg) files which are stored in
a database?

I am successfully using ns_register_proc to catch and
dynamically serve html page requests.

I would also like to dynamically serve the script and
image files that are embedded in those same html files.

I've tried, for example:
   ns_register_proc GET /Images/*.png serve_image
and
   ns_register_proc GET /*.png serve_image
to catch requests for my .png files, but my procedure
serve_image does not get called.

What am I missing?

Thanks,

Greg Davidson


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

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



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

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


Re: [AOLSERVER] aolserver vs lighthttpd, benchmarks

2007-09-27 Thread Bas Scheffers

On 28/09/2007, at 9:28 AM, Dossy Shiobara wrote:
Yes!  Finally, someone else who uses the 404-handler-as-request- 
processor
pattern!  Indeed, you can't beat static file serving performance.   
And,
My first inspiration for this came way back in the last century, from  
working with Vignette StoryServer. Rather bad technology that HAD to  
use caching to be able to serve more than a few pages a second, but  
the way they did it was a neat trick.



The only tricky thing is to handle the "stampeding herd" situation,
where many requests for the same uncached object come in at the same
time.  You only want one request to populate the cache--you want all
At the moment, there is only one server and when the file is  
uploaded, I also pre-cache it. If we ever do need more servers, I am  
thinking of simply having the upload process cycle through a list of  
servers it then does a http request to. I plan to do a similar thing  
for clearing the cache. If the request fails, you can log and queue  
it for a re-try.


If the farm would get beyond two servers, it would be worth looking  
into serving the images only out of two servers (for fail over); no  
need to have all of the app servers keep their own copy!


Bas.


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

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


Re: [AOLSERVER] aolserver vs lighthttpd, benchmarks

2007-09-27 Thread Bas Scheffers

On 28/09/2007, at 5:04 AM, John Buckman wrote:
I've been looking at C-caching of Tcl dynamic content, with "dirty  
cache" support.  For example, replacing the Tcl code that returns a  
user's uploaded photo with C code.


I wrote C code to do this, and got 14k/second vs 240/s for the same  
tcl function.  So, C really is a good replacement for Tcl when a  
particular URL needs to be very fast.
My solution to that problem was simply caching in the filesystem and  
serving static files. The way this works in a multi-server  
environment is that the custom 404 handler figures out the request  
was for "/photo/123/axbcgsfdt.jpg" and just grabs it from the  
database, caches it and redirects back to it.


That way I get the convenience of Tcl code and the speed of static  
files - save for the first request.


Bas.


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

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


Re: [AOLSERVER] aolserver vs lighthttpd, benchmarks

2007-09-27 Thread Bas Scheffers

On 28/09/2007, at 3:38 AM, Dossy Shiobara wrote:
I bet with just a few minutes of tweaking and tuning, we can get  
between

4k-8k simple dynamic req/sec out of your hardware.
Hear, hear. I just blasted my brand-spanking-new Quad 2.6 Mac Pro  
using ab. I was testing my ns_session, so it was doing even more than  
just "hello, world". I was getting between 2500 and 4000 reqs/sec,  
even though I did not tune anything. base.tcl only with just the ip/ 
port changed.


I would suspect Linux being faster on a box like this than OS X (BSD)  
because of better threading support. Or am I wrong in that assumption?


Cheers,
Bas.


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

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


Re: [AOLSERVER] Working with Chinese characters in Tcl/AOLserver

2007-09-05 Thread Bas Scheffers

On 6 Sep 2007, at 08:17, Janine Sisk wrote:
The problem is, Tcl doesn't support utf-8s, and as far as I can  
tell there is no other format that will work.  This will leave me  
stuck with the java program, and I have serious concerns about the  
performance of any sort of exec, let alone one that involves  
writing files.
In that case, would it not make sense to just implement the  
"simplifying proxy" in Java itself (i.e.: use Tomcat or Jetty as  
server) and forget about AOLserver for that? Java's i18n is very good  
and sounds like it might well be the best tool for the job...


Cheers,
Bas.


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

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


Re: [AOLSERVER] Working with Chinese characters in Tcl/AOLserver

2007-09-05 Thread Bas Scheffers
Instead of using exec, have you tried to open a pipe (open "| 
javacmd") and use fconfigure on the I/O channel returned by this?


Cheers,
Bas.

On 5 Sep 2007, at 17:05, Janine Sisk wrote:

This may be more of a Tcl question than an AOLserver one, but I'm  
guessing that people on this list are more likely to have run into  
it.  So here goes.


I'm working with strings encoded in big5 and gb2312 (traditional  
and simplified Chinese, respectively).  I'm exec'ing out to an Java  
program that translates from one to the other.  I have found that  
the only way to get my data to the program intact, and get the  
response back intact, is to store the data in intermediate files  
with the fconfigure command to set the encoding.  Anything else  
ends up mangling the data.  I can't, for example, grab the return  
value of the command directly from the exec;  if I do, it's  
mangled.  I have to have the java program write it to a file, and  
then read it with the encoding set, in order to get the data intact.


As you can imagine, having to write two files per page request  
isn't exactly ideal, even with caching.  So has anyone else done  
this and found a way to do it?


thanks,

janine


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

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



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

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


Re: [AOLSERVER] Switching to Trac to manage the AOLserver project?

2007-08-30 Thread Bas Scheffers
Sounds good to me. They say it integrates with svn, does that also  
mean switching AOLserver to svn?



On 30 Aug 2007, at 13:46, Dossy Shiobara wrote:


Hi,

After looking more closely at Trac [1], I'm really thinking it  
might be a

good idea to use it to manage the AOLserver project.  Does anyone have
any strong feelings about this, particularly against it?

If not, I'll go ahead and set it up this week.

-- Dossy

[1] http://trac.edgewall.org/

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


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

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



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

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


Re: [AOLSERVER] aolserver focus

2007-08-09 Thread Bas Scheffers

On 10 Aug 2007, at 02:54, Tom Jackson wrote:
I have never been able to put my finger on what the issue is here.  
AOLserver

isn't Apache. Sendmail isn't Qmail either. Both compete over a single
privileged port. That is the real issue. Some company only has one  
IP address
and needs to make a choice. Then just run AOLserver on an internal  
IP and
proxy through to it. That is the module. Call AOLserver an  
application server
A perfectly viable way of running, I agree; that is not the reason I  
would like to see such a module. Let's step into the mind of Joe Newbie:


"...hmmm, wat's this thing, AOLserver, let's see. "apt-get install  
apache2-mod-aolserver". OK, so no I create a .adp page with some Tcl  
code. Cool, but I can do that in PHP too. Ah, I see, I create a  
database pool in my .htaccess file and can use it anywhere by name,  
neat! And so if I put a procedure in this init.tcl file, it is  
available anywhere, without the need for stupid include directives on  
every adp page and recompiling the same code over and over again.  
Nice. Lets benchmark this thing. Huh? The same code and database  
calls run how much faster than my PHP version!?"


I know in the case of debian, AOLserver 4.0.10 is available in  
stable, but someone with an "Apache mindset" probably wouldn't find  
or try it. Plus the configuration of it would be much closer to  
Apache's. (yes, mod-aolserver would probably need to give up the  
extreme fine tuning it can do now, but how many people really need  
that anyway?)


Bas.


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

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


[AOLSERVER] memcached (was: Re: [AOLSERVER] aolserver focus)

2007-08-08 Thread Bas Scheffers
I don't think you can solve it in libmemcached, it seems to always  
open and close. You can pool requests, but that would be annoying  
with a page full of elements, I would say.


http://www.outoforder.cc/projects/libs/apr_memcache/ does use  
configurable pooling and would be my choice for AOLserver.


I would not use it as a Tcl module, but rather as a proper AOLserver  
module that exposes Tcl commands. That way you can integrate it in  
such a way that it is shared between all interps and config is done  
in the main config files. (pools and servers)


Bas.

On 8 Aug 2007, at 17:19, Guan Yang wrote:


Bas Scheffers wrote:
http://www.danga.com/memcached/ is brilliant. I have not used it  
in AOLserver yet, though. There is a Tcl only client but for best  
performance you'd probably be best off creating a module using one  
of the C libraries available.


When I last tried memcached, I used the tclmemcached client, which  
links against a C library (libmemcache).


The problem was that it didn't pool the connections to memcached,  
but opens a new connection for each request and was not very good  
at recycling them. This caused some problems on my system.


Is there a solution to this problem? (I was just a memcached  
neophyte, so it might be something obvious.)


/Guan


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

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



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

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


Re: [AOLSERVER] aolserver focus

2007-08-07 Thread Bas Scheffers

On 8 Aug 2007, at 14:08, Tom Jackson wrote:
general indications? Uhhh, I mean what is memcache, how do you use  
it and why
is it useful? Otherwise, it isn't useful to me or anyone else  
without a clue.
http://www.danga.com/memcached/ is brilliant. I have not used it in  
AOLserver yet, though. There is a Tcl only client but for best  
performance you'd probably be best off creating a module using one of  
the C libraries available.


Cheers,
Bas.


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

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


Re: [AOLSERVER] aolserver focus

2007-08-07 Thread Bas Scheffers

On 7 Aug 2007, at 23:07, Dossy Shiobara wrote:

1) JavaScript: the SpiderMonkey JS engine is thread-safe and I've been
   integrating it into AOLserver (see: nsjsapi).  John Resig has  
started

I'll have a look at that soon!


On Apache, lacking nsv's (and nv's), folks use memcache.  Naturally,

But wouldn't nsv be possible now in the multi-threaded mpm?

memcache makes things simpler.  (Yes, memcache is ultimately a  
whole lot

more powerful than AOLserver's nsv's--I know this.)
Depends on what you use it for; I use nsv for my translation  
dictionaries (multi-lingual site); it is a small resource that must  
be shared between interps and doesn't warrant memcache, but using  
interpreter namespace variables like msgcat would not be very nice.


For caching people's profile or product pages and such, memcache  
obviously is the best way to go, however.



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

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


Re: [AOLSERVER] aolserver focus

2007-08-06 Thread Bas Scheffers

On 7 Aug 2007, at 13:08, Mark Aufflick wrote:


tcl is certainly unpopular - (put's on flame retardent suit) - it
doesn't suit structured programming well like, say, ruby and python
Those languages were really only made popular by their use in a hot(- 
ish) new(-ish) web stack, Tcl could achieve the same.



all layers are easily interchangeable. You can use Apache + MySQL with
Perl, Python or Ruby. You can use Perl/Python/Ruby with Postgresql or
I think that is hitting the nail on the head: "You can use Apache +  
MySQL...". People think web development and they think Apache, not in  
the least because that is what every hosting company offers. The  
language is probably second and depends on what runs well inside  
Apache. Unfortunately that would be PHP.


I always shake my head when this "lets implement PHP/Ruby/TechDuJour  
in AOLserver, that will make it popular" comes up. First of all  
everyone seems to find that only Tcl is any good a threading, so you  
can't make other languages fit properly. (That said, most languages  
don't fit well in apache; RoR uses lame forked FastCGI) Secondly, I  
don't care about the AOLserver HTTP layer. Yes, it is fast but so are  
other web layers. What makes AOLserver AOLserver is the Tcl API;  
libraries, ns_db and nsv are what makes it better than anything  
available on Apache.


Personally, I would prefer it to run in Apache and have someone else  
maintain the HTTP layer and being able to have easy, stable virtual  
servers, mod_rewrite, etc. I know AD did a "mod_aolserver" at some  
point but shoehorning a threaded back-end to a forking server was  
probably never a good idea to begin with. With Apache 2 knowing a  
thing or two about threading now it might just work a whole lot better.



I think the tcl coupling - or rather the inability to couple with
other languages easily - is a big problem. Ruby on Rails has shown
I agree, except I think it is the other way around; the inability of  
the Tcl API to run inside anything else than AOLserver.


Although it would kill AOLserver as a stand-alone product, I think  
this is a good model:


- AOLserver Tcl API implemented in Apache 2's threaded model.
- Including pretty much all of tcllib in the distribution
- Same for tdom
- create a cool framework. I am not the greatest fan, but they can  
generate a lot of buzz. A Tcl/ADP clone of WebWork and SiteMesh  
(http://www.opensymphony.com/) should do fine.


You could just have a content handler for .adp files and a config  
directive can point to the Tcl lib dir. Registered procedures and  
ADPs would probably have to be done to in config directives but it  
being apache, all this could be set in .htaccess files for easy  
("untar and call setup.adp") deployment.


Running inside the bloated apache probably won't make it any faster,  
but it also shouldn't make it unworkably slow at all either. (Yahoo!  
seems to have embraced PHP for cryin' out loud and they have a page  
view or two every day...)


Just my 2 cents...

Cheers,
Bas.


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

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


Re: [AOLSERVER] Has anybody tried to port mod_auth_kerb to AOLServer / Naviserver?

2007-07-31 Thread Bas Scheffers
Not entirely sure, but if you were willing to run the server on  
Windows, you should be able to create a much simpler module than  
mod_auth_kerb using the MS functions; send the right headers for IE  
to return the NTLM token, check its validity using MS code and then  
just get the username out of it.


Bas.

On 1 Aug 2007, at 09:26, Rick Cobb wrote:

We’re getting a lot of requests for real Windows “single-sign-on”.  
That is, no sign on at all if the user’s already logged into their  
Windows domain.  This is for corporate deployments, obviously. The  
Apache community apparently has a module known as “mod_auth_kerb”  
for this. Has anybody worked on porting it to AOLServer?  
NaviServer?  We’ve already done LDAP deployments; that’s not  
sufficient for this community (since it still requires you to log  
in to the web server).


Thanks –
-- ReC
-- AOLserver - http://www.aolserver.com/

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





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

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


Re: [AOLSERVER] ns_session (C module) and IE7

2007-07-18 Thread Bas Scheffers

I haven't tested it yet, but a quick google found this:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1214771&SiteID=1

Are you using pop-ups?

I'll look into it further soon!

Bas.


On 19 Jul 2007, at 05:25, Ian Harding wrote:


Has anyone else had trouble with this?  Firefox, Safari, etc are fine,
but IE7 with even the most lax security setting does not set my
session cookies.

- Ian


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

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



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

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


Re: [AOLSERVER] Ns_write doesn't seem to close the socket

2007-07-13 Thread Bas Scheffers
ns_write is designed to be called multiple times so you can "stream"  
content to the client. It is not designed to close the connection  
after one call!


Have you tried "ns_conn close"?

Cheers,
Bas.

On 13/07/2007, at 9:59 AM, JAMSHED QURESHI wrote:


Hi,


Upon receiving the request i'm calling ns_write like so:

proc request {} {
set retstring "HTTP/1.0 201 Created\nMIME-Version: 1.0\nDate:  
Fri, 13 Jul 2007 08:46:46 GMT\nServer: AOLserver/4.0.10\nContent- 
Type: application/x-tcl-list\nContent-Length: 77\nConnection: close 
\n\nSUCCESS"



ns_write $retstring;

   # do content processing here


}


Http client makes the request, and receives the reply but the  
connection is not closed until another 20 seconds (timeout set for  
http client).



kind regards,
jamshed


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


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






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

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


Re: [AOLSERVER] Internal Redirect, Original URL?

2007-07-10 Thread Bas Scheffers

This should do the trick:

[lindex [split [ns_conn request]] 1]

Bas.

On 10/07/2007, at 3:53 PM, Ian Harding wrote:


If you use the internal redirect mechanism like this

ns_section "ns/server/${servername}/redirects"
ns_param   404 "/notfound.adp"  ;# Not Found error page

And your notfound page wants to know what URL they originally asked
for, [ns_conn url] won't tell you, since you have already been
redirected.

Is there any way to find out where you were internally redirected  
from?


- Ian


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

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



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

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


Re: [AOLSERVER] nspostgres-4.1 released

2007-06-26 Thread Bas Scheffers

On 27 Jun 2007, at 11:54, Jim Lynch wrote:
I don't believe it would be useful to require aolserver to have to  
watch for
dropped connections to aolserver; that takes an extra process or  
thread and

CPU time that should be used for what aolserver's job is.
The postgres driver could easily do a quick check before every query  
using PQstatus(), followed by a PQreset() if the result was  
CONNECTION_BAD.


Or only do it when the connection is gotten from the pool.

Though I do not know 1) how reliable PQstatus is and 2) how efficient  
it is. I agree efficiency is the number one priority. I find  
AOLserver (non-ACS anyway) tends to recover very well from a Postgres  
restart. Maybe one error page per connection it had open, but that  
connection seems to then be discarded and a new one created on the  
next request.


In any case, I think it would be best if this were implemented per- 
driver rather than an AOLserver wide implementation as then it can be  
done in the most efficient way for the database in question.


Having said all this, would it be possible to add a feature to  
aolserver
where an admin sends a signal to aolserver which responds by trying  
to open

database connections?
Or just close all existing ones, so new ones are re-opened when  
required.


Cheers,
Bas.


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

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


Re: [AOLSERVER] nssession 1.0RC1

2007-06-19 Thread Bas Scheffers

I just posted RC2 on http://bas.scheffers.net/aolserver/

This adds the keyword "never" to the possible values of expires.  
Using this instead of a date a long time into the future will make it  
possible to change the underlying code to not have a Y2033 problem  
when cookie specs finalize.


I also updated the documentation of this in the README.

Cheers,
Bas.


On 20 Jun 2007, at 10:08, Bas Scheffers wrote:


On 20 Jun 2007, at 09:36, Dossy Shiobara wrote:

Hey everyone!  Look at Bas, planting the seed for the Year 2033 bug!
Haha! yeah, you have a valid point. But I didn't do it, some dude  
at Netscape in 1995 did! AOL bought Netscape, you work for AOL, so  
it is all your fault, really! :P


There are two RFCs concerning cookies that address the problem of  
needing hard expiry times (as set by the Netscape spec) but from  
what I read, they may not be well supported by all clients. For  
now, the netscape spec works reliable as long as you don't do  
stupid things like setting the expire one hour into the future; if  
the user's computer clock is off your application might well not  
work at all. Either go for a session cookie, or set it to expire  
many years into the future.


Cheers,
Bas.


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

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



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

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


Re: [AOLSERVER] nssession 1.0RC1

2007-06-19 Thread Bas Scheffers

On 20 Jun 2007, at 09:44, Jeff Rogers wrote:
Just in case this is running for 5 or so years, is this susceptable  
to a Y2038 bug?
No, it wouldn't because the 2,000,000,000 value is hardcoded and not  
relative to "now".


But there is, as Dossy pointed out a Y2033 bug if you leave this  
unchanged for 26 years or so.


Cheers,
Bas.


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

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


Re: [AOLSERVER] nssession 1.0RC1

2007-06-19 Thread Bas Scheffers

On 20 Jun 2007, at 09:36, Dossy Shiobara wrote:

Hey everyone!  Look at Bas, planting the seed for the Year 2033 bug!
Haha! yeah, you have a valid point. But I didn't do it, some dude at  
Netscape in 1995 did! AOL bought Netscape, you work for AOL, so it is  
all your fault, really! :P


There are two RFCs concerning cookies that address the problem of  
needing hard expiry times (as set by the Netscape spec) but from what  
I read, they may not be well supported by all clients. For now, the  
netscape spec works reliable as long as you don't do stupid things  
like setting the expire one hour into the future; if the user's  
computer clock is off your application might well not work at all.  
Either go for a session cookie, or set it to expire many years into  
the future.


Cheers,
Bas.


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

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


Re: [AOLSERVER] nssession 1.0RC1

2007-06-19 Thread Bas Scheffers

Hi Ian,

Good to hear someone is using it!

I guess I didn't document it very well. You need to pass it a valid  
HTTP time string. The easy way to get it to never expire is to pass  
the value of:

[ns_httptime 20]

That tells it to expire "Wed, 18 May 2033 03:33:20 GMT", which ought  
to be long enough in the future! :)


Cheers,
Bas.

On 20 Jun 2007, at 05:04, Ian Harding wrote:


Hello,

I am trying to use ns_cookie for the first time and am not having any
luck getting a persistent cookie set.  Session cookies seem to get set
regardless of the value I send for expires.  Am I doing something
wrong?

ns_session is working great, this is the first time I tried to use the
ns_cookie commands.

Thanks,

Ian

On 2/24/06, Bas Scheffers <[EMAIL PROTECTED]> wrote:

Jeremy Collins wrote:
> Is this the same module that is in AOLserver CVS?  Doesn't look  
like it

> but they have the same name.
No, it isn't. I think that is one someone started many eons ago  
and is

still "alpha". I think it needs replacing with something that is
maintained! :)

> One thing that might be useful is a way to provide storage  
plugins for

> session data.  If I could write a few routines, my_session_save and
That is a good idea, one I have thought about but didn't need and so
didn't implement.

But all operations are in an Ns_Set, so it doesn't matter where it  
comes

from, as long as it is put into a set for getting/setting. So all the
implementation module would need to provide is GetSet(), SaveSet()  
and
Destroy() functions. And maybe a "request done" function the trace  
calls

so the memory cache your implementation would probably have can be
committed to the back end storage at the end of the request.

It could just be a loadable module that registers the functions to  
call

with Ns_Session and overwrites the default ones.

One thing I would like is a small core change, it would be nice to  
have
a simple char* in the NsConn struct to store the session ID,  
rather than

my nasty request parameters hack.

Another slight performance improvement would be a pointer to the  
cache
in NsServer, saving the find that is now needed on every access to  
the

cache.

Cheers,
Bas.


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

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





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

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



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

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


Re: [AOLSERVER] AOLServer 4.5.0 redirecting with 302 for requests where there is no trailing slash on a directory

2007-01-20 Thread Bas Scheffers
Also, Squid *should* be able to detect and re-write this as well.  
(well, I think it should; it might, I don't know) Apache's mod_proxy  
certainly does this.


This is useful as you can also re-write directories, ie: a request to  
"/" on the proxy goes to "/site/" on nsd; when nsd redirects "/site/ 
doc" to "http://server:8000/site/doc/";, the proxy should re-write  
this to "http:/realhost/doc/".


Cheers,
Bas.


On 19 Jan 2007, at 23:37, Tom Jackson wrote:


Nick,

You have to setup the location parameter.

Here are some notes from :

#
# Notes:
# You must set the location parameter correctly in your proxied hosts'
# startup file nsd.tcl.
#
# If you want your web domain name to be www.example.com
# set up the following in you nsd.tcl file:
# ns_section "ns/server/${servername}/module/nssock"
# ns_paramport  8000;# Actual  
private port
# ns_paramhostname  www.example.com;# Internet  
Hostname
# ns_paramaddress   192.168.1.2 ;# Actual  
private ip
# ns_paramlocation  http://www.example.com ;#  
Protocol://Hostname


# The location parameter is essential for automatic redirects and  
for proper

# use of [ns_conn location], otherwise redirect would go to
# http://www.example.com:8000
#


tom jackson


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

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



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

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


Re: [AOLSERVER] example database configuration wit nspostgres on aolserver 4.5

2006-10-26 Thread Bas Scheffers
You load nsdb in the server's modules section:

ns_section "ns/server/${servername}/modules"
ns_param nssock ${bindir}/nssock.so
ns_param nslog ${bindir}/nslog.so
ns_param nsperm ${bindir}/nsperm.so
ns_param nsdb ${bindir}/nsdb.so
ns_param nssession ${bindir}/nssession.so
ns_param nscp ${bindir}/nscp.so

# Then load the postgres driver:

ns_section "ns/db/drivers"
ns_param   postgres_driver nspostgres.so

# Create a pool:

ns_section "ns/db/pools"
ns_param   sativo"Sativo Pool"

# define the pool:
ns_section "ns/db/pool/sativo"
ns_param   driver  postgres_driver
ns_param   datasource  localhost:5432:sativo2
ns_param   usernsd
ns_param   passwordxx
ns_param   connections 20
ns_param   logsqlerrorstrue  ;# Verbose SQL query error logging
ns_param   verbose false ;# Verbose error logging
ns_param   maxidle 600   ;# Max time to keep idle db conn
open
ns_param   maxopen 3600

# Give the server access to pools:
ns_section "ns/server/${servername}/db"
ns_param pools  *;# Wildcard gives access to all
ns_param defaultpoolsativo

And that should do the trick!

Bas.

On Thursday, October 26, 2006 8:50, Dino Vliet said:
> Hi peeps,
>
> can someone provide me an example of a configuration
> from aolserver 4.5? I'm especially interested in the
> database parts so what has to go exactly into the
> ns/db parts and what modules to use.
>
>
> I'm particular confused if the nsdbo.so has to be
> loaded or not in the modules section. According to
> this link,
> http://panoptic.com/wiki/aolserver/Annotated_AOLserver_Configuration_Reference,
> it doesn't have to load but I don't get any response
> from my efforts. The server loads without database
> driver and thats frustating.
>
> Hope you can help me out
>
>
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>
> --
> AOLserver - http://www.aolserver.com/
>
> To Remove yourself from this list, simply send an email to
> <[EMAIL PROTECTED]> with the
> body of "SIGNOFF AOLSERVER" in the email message. You can leave the
> Subject: field of your email blank.
>


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

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


Re: [AOLSERVER] OT: Who owns aolserver.com?

2006-10-18 Thread Bas Scheffers
I would guess very, very little; all the downloads will stil be comming
from sourceforge, so it's just some page views.

Bas.

On Wednesday, October 18, 2006 13:12, Chris Kumagai said:
> Does anyone know what kind of bandwidth would be necessary?
>
> -Chris
>
>
>
> - Original Message -
> From: Daniël Mantione <[EMAIL PROTECTED]>
> Date: Wednesday, October 18, 2006 12:56 am
> Subject: Re: [AOLSERVER] OT: Who owns aolserver.com?
> To: AOLSERVER@LISTSERV.AOL.COM
>
> >
> >
> > Op Wed, 18 Oct 2006, schreef Bas Scheffers:
> >
> > > That's been a sore point for a long time; one that I am trying
> > to solve
> > > with Dossy's blessing. Unfortunately, having a busy project at
> > work and
> > > building work going on at home hasn't sped things up. I came as
> > far as
> > > preparing AOLserver for an OpenACS install, but got stalled there.
> > >
> > > If anyone - especially and OpenACS expert, like someone from
> > that group -
> > > would like to help out, it would really be appreciated.
> >
> > I can help set up an OpenACS installation if necessary.
> >
> > Daniël
> >
> >
> > --
> > AOLserver - http://www.aolserver.com/
> >
> > To Remove yourself from this list, simply send an email to
> > <[EMAIL PROTECTED]> with the
> > body of "SIGNOFF AOLSERVER" in the email message. You can leave
> > the Subject: field of your email blank.
>
>
> --
> AOLserver - http://www.aolserver.com/
>
> To Remove yourself from this list, simply send an email to
> <[EMAIL PROTECTED]> with the
> body of "SIGNOFF AOLSERVER" in the email message. You can leave the
> Subject: field of your email blank.
>


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

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


Re: [AOLSERVER] OT: Who owns aolserver.com?

2006-10-18 Thread Bas Scheffers
That's been a sore point for a long time; one that I am trying to solve
with Dossy's blessing. Unfortunately, having a busy project at work and
building work going on at home hasn't sped things up. I came as far as
preparing AOLserver for an OpenACS install, but got stalled there.

If anyone - especially and OpenACS expert, like someone from that group -
would like to help out, it would really be appreciated.

Cheers,
Bas.


On Wednesday, October 18, 2006 10:29, JM said:
> hi,
>
>   IIRC aolserver.com is the official site for aolserver... i last visited
> the
> site and www.aolserver.com is running under apache... :(
>
>
> Mailing-list
>
> DISCLAIMER: This Message may contain confidential information intended
> only for the use of the addressee named above. If you are not the intended
> recipient of this message you are hereby notified that any use,
> dissemination, distribution or reproduction of this message is prohibited.
>  If you received this message in error please notify your Mail
> Administrator and delete this message immediately. Any views expressed in
> this message are those of the individual sender and may not necessarily
> reflect the views of GMA New Media, Inc.
>
>
> --
> AOLserver - http://www.aolserver.com/
>
> To Remove yourself from this list, simply send an email to
> <[EMAIL PROTECTED]> with the
> body of "SIGNOFF AOLSERVER" in the email message. You can leave the
> Subject: field of your email blank.
>


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

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


Re: [AOLSERVER] AOLServer crashes when loosing DB connection

2006-09-27 Thread Bas Scheffers
What database and drivers do you use? I have no such issues with Postgres...

Bas.

On Wednesday, September 27, 2006 12:23, Nima said:
> Hi all,
>
> is there a way to configure the AOLServer not to crash if it looses the
> connection to the database. When ever I restart the database the aolserver
> crashes instead of delivering an error page or reconnecting to the
> database. The reason why I am asking is that we would like to define
> several database pools to legacy systems but when one of the databases is
> restarted the aolserver crashes.
>
> Greetings,
> Nima
>
>
> --
> AOLserver - http://www.aolserver.com/
>
> To Remove yourself from this list, simply send an email to
> <[EMAIL PROTECTED]> with the
> body of "SIGNOFF AOLSERVER" in the email message. You can leave the
> Subject: field of your email blank.
>


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

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


Re: [AOLSERVER] AOLserver's documentation woes and its future

2006-09-06 Thread Bas Scheffers
On Wednesday, September 6, 2006 16:56, Tom Jackson said:
> it. We can introduce the unique AOLserver APIs to this project. But now we
> are back to the beginning: AOLserver isn't unique because of the Tcl
> language
> after all, it is unique because of the way it solves a particular problem.
> If
> developers don't like that uniqueness, it doesn't matter what languages
> are
> supported.
I agree, I like AOLserver for what it does; a fast multi-threaded server
with DB support better than anyone else's, shared variables better than
anyone else's and scripting support (Tcl libs, re-use of the interpreter,
etc) better than anyone else's. I happen to like Tcl, but the same thing
implemented in Perl or other "toy language" would be equally appealing.
The language is just the glue.

To be honest, the only thing that comes close is Java, in a good server
like Orion. And Java certainly isn't for beginners; apparently even
Greenspun's MIT students can't tame it without programming themselves into
an OO corner...

I really think what's needed is to include a lot more and pretend it is
ours, or at least thoroughly embrace it (TclLib, tdom) and everything is
in one place. See my other post for that.

If we can than create some more "out-of-the-box" modules like an SQL user
repository with API, a framework for making a site multi-lingual (Tcl
msgcat wrapper, really) and the like and praise it for all it is worth,
like other projects do, I think we have a fair chance of popularizing
AOLserver.

Now about the name...

Bas.


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

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


[AOLSERVER] Addming more stuff to AOLserver

2006-09-06 Thread Bas Scheffers
As part of a popularity drive, why don't we add more stuff to AOLserver?

TclLib and tdom in the standard build sound like a good idea. So I believe
is my sessions modules. We could merge their documentation into the
AOLserver docs, so all is in one place. The same with the Tcl man pages,
reformatted to fit in with the rest of the AOLserver docs.

Have a look at the PHP docs and you will see what I mean; everything is in
one place.

Would it make sense to call AOLserver specific commands that can be
replaced with things from standard Tcl or TclLib "deprecated"? (ie:
ns_urlget is still there and documented, but we advise people to use the
Tcl HTTP package instead)

We should also make DB drivers simpler; --with-postgresql and
--with-mysql, etc. build options would make sense. Again, include as much
as we can in a single download.

The goal would be that you can just download and build (or install RPMs or
.debs, if someone wants to create and maintain those) and all you need
will be there, documented in one place on aolserver.com. That would really
lower the barrier to entry by people unfamiliar with Tcl; it will just
seem as if Tcl is part of AOLserver itself.

Cheers,
Bas.


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

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


[AOLSERVER] Dumbing down AOLserver

2006-09-05 Thread Bas Scheffers

Strange title, I know. But hear me out.

I talked before about creating easy to deploy "AOLserver  
Applications". This is do-able the way I described it, but to do it  
right, quite invasive in the core. And it probably still won't be  
simple enough for people used to PHP deployments.


Here are some other thoughts to make deploying a new app as simple as  
it is in PHP:


- On demand pools
I looked into the nsdb code and nothing seems to indicate that you  
can't define pools at any time you please. So a special "ns_db  
gethandle" that takes something like "nsdb:postgres:localhost:5432/ 
mydb?user=foo&password=bar&timeout=10&max=20" should be  
implementable. It would create a handle name from the arguments  
(rewrite them; people could use a different order of arguments in  
different places...) and then see it the pool exists. If not, define  
the pool and then continue as normal.


All this would require from the user is editting the main config file  
with:


ns_section "ns/db/drivers"
ns_param   postgres nspostgres.so

in fact, "base.tcl" could do a "file exists" for every know database  
driver and load it if it is there.



- On demand libraries
create an "ns_libload" command. sources a tcl file from the given  
location (relative), in the global scope. In a special namespace in  
the interpreter, an array is kept of which have been loaded and what  
the mtime was. With the "ns_libload_mode" command you can set it to  
"always", "check" and "persist". Check would be default; ever time  
the ns_modload for that file is called, the mtime is checked; if it  
is new, load it. This would overwrite any procs with the same name  
that already exist. Because every interpreter loads any library only  
once, this should be just as efficient as the current libs. (when set  
to persist, of course!)


Good practice would be to only ever source 1 library in any .adp,  
which in turn takes care of sourcing anything, but that is up to the  
user.


- .nsaccess files
Work pretty similar to Apache's .htaccess. They are sourced by  
"walking back" the directory tree and the first one found counts for  
all subdirectories. These could have a section of stuff that needs to  
be executed before the actual URL is processed. This means you could  
do a request to /news/story/1234.html and the .htaccess in the news  
directory would be called first and does an ns_registerproc to handle  
"/news/story*". A run-once section could be used to schedule procedures.


The last on is the most invasive in the core, but the first two seem  
very do-able. The library thing can be done entirely in Tcl, probably  
in an hour or two! But it's no good without also doing the first.  
(database on demand)


My goal with this all is that all a user needs to do to install  
"ns_wiki" is to:

# cd /usr/local/aolserver/servers/server1/pages
# tar -xvzf ns_wiki.tar
# mv ns_wiki wiki
# chown nsd wiki/wiki.cfg

A "setup.adp" could ask for database detail, work out where it is so  
it can register the correct urls and take all other sorts of config  
paramters.


Of course, none if this will change the behaviour of any existing  
AOLserver apps, which is the beauty of this solution!


Any thoughts?

Bas.


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

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


Re: [AOLSERVER] AOLserver's documentation woes and its future

2006-09-05 Thread Bas Scheffers

On 5 Sep 2006, at 18:54, Dossy Shiobara wrote:

Of course, non-AOL employees are free to speak and speculate all you
want.  We just can't confirm or deny any of it.

Here goes my speculation then!

From between the lines in the past, I picked up that AOL business  
units are getting a bit of freedom to choose technologies. Probably  
not in the least because like other "portals" AOL does buy existing  
tech; if you buy a small website with a service you want to add to  
your portfolio and get to market quickly, you just buy it and don't  
go and port it all to AOLserver.


I am sure that on top of that even for "from scratch" products,  
business unit managers probably like "hot" tech too and try their  
very best not to use AOLserver at times.


Though probably there is an *aweful* lot of code in AOL that is  
completely dependent on AOLserver and I'll end my speculation with  
saying that AOL won't be offloading AOLserver any time soon, even if  
they scale back some future ("cool") developments.


But that shouldn't stop anyone in the comunity from implementing  
these, though!


Bas.


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

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


Re: [AOLSERVER] AOLserver's documentation woes and its future

2006-09-05 Thread Bas Scheffers

On 5 Sep 2006, at 17:57, Titi Ala'ilima wrote:
1) AOLserver probably needs a new name.  Something that uses the NS  
initials would be ideal so that all those ns_* commands actually  
make sense again.  Could we resurrect the NaviServer name?
Already taken! (OpenSource fork-without-anyone-from-AOL-interfering  
of AOLserver)


Bas.


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

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


Re: [AOLSERVER] AOLserver's documentation woes and its future

2006-09-05 Thread Bas Scheffers

On 5 Sep 2006, at 17:22, Jean-Fabrice RABAUTE wrote:

I have one webserver at home and only 1 public IP.
I have some web sites on PHP and some very few intranet pages on
aolserver/TCL.
I wanted to use aolserver, and virtual hosts.
I simply solve this (in various places) by having apache listen on  
the one IP and using mod_proxy to forward requests for certain urls  
or name-based virtual hosts to AOLserver, which works a treat!


Cheers,
Bas.


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

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


Re: [AOLSERVER] AOLserver's documentation woes and its future

2006-09-05 Thread Bas Scheffers
On Tuesday, September 5, 2006 15:50, Rick Gutleber said:
> Support for more popular languages (come on, let's say it together, I
> know it's hard, but "Tcl is not popular") is probably the most useful
> long-term technical change that can be made.  This isn't an indictment
As long as it is anything but PHP! This is not because I do not like PHP
very much but because - even though it is the most popular language - is
the only language that *doesn't* make sens to use in AOLserver.

I know this sounds strange, but think about: throughout its evolution, PHP
has always been closely tied to Apache. So you could integrate it with
AOLserver and expose the AOLserver API in it, but who would use it? The
majority of people will always use Apache with PHP and why would you write
a PHP app that isn't compatible with Apache? And without using the API,
what advantage does AOLserver have over Apache 2 running PHP?

Languages like Perl and Ruby are much more likely candidates. The only
"standard" thing when it comes to those for interacting with the server
they are running in are "CGI variables". If you want to do it right you'd
implement Perl:DBI to under the hood use on-the-fly generated AOLserver
pools, but that's about it.

That said: I still believe AOLserver is all about Tcl and the tight
integration with it. It would be a shame to fragment the community;
"sorry, can't help you, I only use Perl in AOLserver", etc. Add too many
of these things and AOLserver will just because another jack of all trades
like Apache.

Either make AOLserver an Apache module that kicks every other module's
arse (so much so Tcl is cool again) or keep it like it is, except better
documented and easier to get started with.

Just my thoughts,
Bas.


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

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


Re: [AOLSERVER] AOLserver's documentation woes and its future

2006-09-05 Thread Bas Scheffers
On Sunday, September 3, 2006 16:58, John Buckman said:
> 2) there is lots of good competition - everything from Ruby, Python
> and Zope to LightHttpd is in the same kind of mind space --
> alternatives to Apache that have cool ideas in them.
Well, half of those actually run inside Apache, they are not really an
alternative to it.

> 3) the name is a small problem -- I have to explain it to people, but
I agree. Most people around me respect my knowledge and experience when it
comes to web applications, yet I still have a very hard time to convince
them this is good technology; let alone convincing them to use it
themselves...

> 4) tcl is more of a problem, people just don't want to learn a language.
I don't agree with this one, though! People learn new languages all the
time to use new technology; PHP and Ruby are good examples, very few
people learn these for any other reason than to create web apps. If they
hear about some cool new framework and get interested in it, they will
pick it up.

I know Tcl isn't "cool", but we all know it is far superior to PHP's mess
of 100 different commands that behave every so slightly different to
achieve pretty much the same task. It was my first language and I still
believe it is the best language fo any beginner. We should promote Tcl
hard.

> 6) pick on apache's weak spots, most specifically, languages that are
> cool but run very slowly in apache.  Ruby is what comes to mind --
Not sure about running a "negative" campaign, so it has to be very subtle.
That said, there is nothing wrong with pointing out (with proof in
benchmarks!) that the same task in AOLserver Tcl runs rings around
anything in PHP.

As a joke about LAMP: "Linux, Aolserver, My own damn code & Postgres!" ;-)

What about the website? I *really* think we should move this to AOLserver;
we have to practice what we preach! Maybe just go with OpenACS? Any
experts on that who would want to be technical lead on that? If hosting is
a problem (I hope not at AOL!) I am perfectly willing to host it. I share
an underutilzed fast box on an even faster internet connection in
Telehouse in London and we'd have no problems with select members of this
community having logins to it.

Bas.


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

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


Re: [AOLSERVER] A wolf in sheep's clothing: AOLserver behind Apache (was Re: AOLserver's documentation woes and its future)

2006-09-01 Thread Bas Scheffers

On 1 Sep 2006, at 22:29, dhogaza@PACIFIER.COM wrote:
For the old, non-threaded Apache 1x.  My understanding is that the  
Apache

2x is quite different, and mod_aolserver would not be a trivial task.
Apache 2 still has the forking thing as well, just depends on how you  
config it.


But yeah, a good solution (which means using multi-threaded Apache 2)  
won't be trivial. You'd have to integrate it a lot more than  
mod_aolserver ever did to be taken as a serious Apache module. It  
would have to be more like PHP, but somehow find a way to use the  
things that make the AOLserver API great. (like Tcl libs instead of  
"include_once" or whatever it is called)


Those changes needed would also make it non-trivial to port any  
complex AOLserver applications to it.


Bas.


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

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


Re: [AOLSERVER] A wolf in sheep's clothing: AOLserver behind Apache (was Re: AOLserver's documentation woes and its future)

2006-09-01 Thread Bas Scheffers

On 1 Sep 2006, at 21:41, Dossy Shiobara wrote:

It's conceivable that you could run Apache as the web server (handling
HTTP requests) sitting in front of AOLserver as the "application
server."  We all understand why this is largely unnecessary, but
presumably it would get you past the auto-immune reaction of your
customers.

Didn't ArsDigita create a "mod_aolserver" for this reason at some point?

To be honest, I think a *great* Tcl/ADP implementation running inside  
Apache has a better chance of being rather popular than AOLserver as  
a standalone product, even if it wouldn't be as efficient.


Just a thought.

Bas.


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

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


Re: [AOLSERVER] Is tcl exec _really_ bad with threads

2006-08-30 Thread Bas Scheffers
I use exec for Image Magick, though not in a high-concurrency environment.
I wonder how Photo.net deals with this; I always understood they use Image
Magick this way. Maybe they did in the beginning and have now switched to
a module?

Does anyone have experience with using TclMagick inside AOLserver?

Cheers,
Bas.


On Wednesday, August 30, 2006 4:29, Jeff Hobbs said:
> Tom Jackson wrote:
> > On Saturday 19 August 2006 21:07, Tom Jackson wrote:
> >> On Saturday 19 August 2006 19:12, Hossein Sharifi wrote:
> >>>  (although I do plan to fix the
> >>> incorrect usage of exec as well)
> >> So I've never heard that you can't use exec from AOLserver. How is this
> >> supposed to be done? Where was this discussed? What would an error look
> >> like?
> >
> > Sorry to respond to my own last post, but I've been trying to find out
>> more
> > about this problem of using tcl exec.
> >
> > As far as I can tell, the problem is trying to use fork (in some tcl
>> extension
> > that adds this) and not calling exec in the child process. Is this even
> > possible in exec to not call exec?
> >
> > Does anyone know the status of this problem in the tcl community, from
>> what I
> > have read, the solutions would not be good for AOLserver.
> >
> > The best rundown, with links, is here:
> >
> > 
>
> Haven't written that thread, what else more specifically do you want to
> know?  ActiveTcl has been shipping thread-enabled for the last several
> releases.  There are some issues with non-core packages (and Tk itself,
> but more recently resolved), but it has worked well in general.  OS X
> also is thread-built, and even has pthread_atfork usage on Tiger, but it
> is slightly prone to issues, and OS X has a different fork()
> implementation than some other common unix variants.
>
> You are correct that the main problem is in trying to fork when not
> closely followed by exec*().
>
> Jeff
>
>
> --
> AOLserver - http://www.aolserver.com/
>
> To Remove yourself from this list, simply send an email to
> <[EMAIL PROTECTED]> with the
> body of "SIGNOFF AOLSERVER" in the email message. You can leave the
> Subject: field of your email blank.
>


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

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


Re: [AOLSERVER] error: 'unable to realloc XXXX bytes'

2006-08-17 Thread Bas Scheffers
On Thursday, August 17, 2006 8:13, Marc Kalberer said:
> My dirty "work around" is a cron that periodicaly check if an nsd
> process is available and if not retstart aolserver.
You should consider running AOLserver using Daemontools; it works like a
charm and much more reliable than scripts looking for a process. Not to
mention it would restart it instantly, not when a script decides to check!

http://openacs.org/doc/current/install-openacs-keepalive.html

Cheers,
Bas.


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

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


Re: [AOLSERVER] nsopenssl dropping connections

2006-07-24 Thread Bas Scheffers
Very interesting stuff, be sure to put it on the Wiki for prosperity!


On Monday, July 24, 2006 4:35, Scott Goodwin said:
> I've done more research on the issues you had with your very heavily
> loaded server, and here's a summary of some of the configurable
> parameters that affect how many connections a server can handle at
> one time.
>
>
> Part I: The Operating System listen backlog limits
>
> Network applications use the listen() system call to notify the
> operating system that they want to receive connections on a specific
> port. The operating system's TCP stack receives new connections and
> holds them until the application uses the accept() system call which
> ties the new connection to the userspace application. The TCP stack
> can hold a limited number of new connections that have not yet been
> accept()ed by the application -- this is called the "listen backlog".
> Eons ago, the default maximum listen backlog for most Unices was 5;
> when there were 5 new connections in the listen queue that had not
> been accept()ed by the application, all new connections coming in
> were dropped until the backlog dropped below 5. Most operating
> systems have higher defaults as specified by the SOMAXCONN defined in
> the /usr/include/socket.h file: the Linux 2.6 kernel and Mac OS
> 10.4.x both set SOMAXCONN to 128. If your server is receiving new
> connections at a rate faster than your application can accept() them,
> and the listen backlog builds to 128, new connections after that will
> be dropped until the backlog is reduced to below 128.
>
> This doesn't mean you're stuck with this value, this is just what the
> operating system will default to at boot time. You can change this
> value on Solaris with:
>
>   /usr/sbin/ndd -set /dev/tcp tcp_conn_req_max_q 1024
>
> and on Linux with:
>
>   /sbin/sysctl -w net.ipv4.tcp_max_syn_backlog=1024
>
> In fact, my Gentoo system modifies this parameter at boot time to be
> 1024.
>
> My guess is that your operating system has max listen backlog set to
> 1024 or higher, but I don't have a Solaris system to check or test
> this (yet).
>
>
> Part II: AOLserver listen backlog limits
>
> You can change the max listen backlog with the listen() call itself
> on a per-application basis: the second argument to listen() is an
> integer value of what you want the backlog to be set to for that
> application. If you set the backlog to be greater than the operating
> system setting, you'll get the operating system's listen backlog
> value, not what you requested, but you won't know that because
> normally your setting is silently truncated to match the lower
> operating system value.
>
> If you set the listen backlog to less than the operating system's max
> listen backlog, you'll get what you asked for. This is a good way to
> prevent a single application on a system where there are several
> network server applications running from hogging the listen backlog.
>
> AOLserver 3.5.6 limits the listen backlog to 32 new connections via
> the BACKLOG define in nsconf.h. If your server is getting new
> connections at a rate faster than AOLserver can accept them, and you
> reach the limit of 32 in the listen queue, connections will be
> dropped until the backlog drops below 32.
>
> You can change AOLserver's listen backlog by creating the
> "listenbacklog" param in your nsd.tcl file and setting it to an
> integer value you would like. I'm guessing that this param should be
> set in the server section, but I haven't validated this. You could
> also change it by changing the BACKLOG define and recompiling.
>
>
> Part III: Thread and select()/poll() interactions
>
> The bad news is that this may not be what you saw on your server. I
> say that because if connections are being dropped by the operating
> system before they are accepted by the application, then the
> application would never even see them or know the connection attempts
> had been made, and so could not log that the connection had been
> dropped. But, according to the notes in the accept() man page on
> Linux: "There may not always be a connection waiting after a SIGIO is
> delivered or select(2) or poll(2) return a readability event because
> the  connection might have been removed by an asynchronous network
> error or another thread before accept() is called." It's quite
> possible that AOLserver was getting readability events but when it
> went to process them, the connections were gone -- whether that means
> they were already handled by another thread or dropped I do not know.
>
> Conclusion:
>
> I'm not yet a guru when it comes to the TCP stack and its interaction
> with userspace applications and threads, so don't bet the ranch on my
> analysis. It's also possible that there's some issue in OpenSSL or
> nsopenssl that is causing this problem. The fact that nsopenssl is
> calling Ns_QueueConn and failing on the result tells me that the
> problem is occuring in AOLserver's connection management or in the
> operati

Re: [AOLSERVER] [ANN] AOLserver 4.5.0 released!

2006-07-06 Thread Bas Scheffers

On 6 Jul 2006, at 20:20, internet wrote:
Is it fair to assume that those memory usage problems have been  
eliminated in AOLserver 4.5.0 when used with Tcl 8.4.1.3?
I'd say so. I believe I was the first to notice the problem with Tcl  
8.4.7 or something. It was never something that was a problem with  
the AOLserver code base, pure Tcl. It got fixed in 8.4.10, so as long  
as you use that or later, I believe 4.5 will be absolutely fine.


Cheers,
Bas.


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

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


Re: [AOLSERVER] Scaling at the high end

2006-07-05 Thread Bas Scheffers

On 5 Jul 2006, at 19:43, Tom Jackson wrote:
performance from an SQL database. However, if you use the BDB  
database, you
will still have to go through some sort of database API, either the  
one which
exists, or a custom designed API. The purpose of the built in API  
is to share
connections across threads and even virtual servers, but it isn't  
really

suited for simple key/value lookup.
That's what I noticed when looking at Vlad's nsberkeleydb module. I  
was expecting something more like the existing Tcl module for BDB  
provided by Sleepycat themselves, except extended to always operate  
in an enviroment and maintain its own pool.


I guess the nsdb driver is easier to implement, but it doesn't seem  
ideal.


Overall, it seems like BDB or cdb would have the same memory  
requirements of
an nsv array, but they require some kind of API to get to this  
memory. Since
BDB has other advantages too, like the "secondary" databases with  
other indexes to your data than just the primary key. This would be  
very useful for finding only, say, blog entries belonging to one blog.


Plus they scale to many gigabytes on disk, something nsv doesn't.

On a side note: does anyone know if there are actual maintained,  
production quality, BSD licensed versions of "Berkeley DB" out there?


Cheers,
Bas.


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

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


Re: [AOLSERVER] Building 4.5 on OS X - .dylib vs. .a

2006-07-05 Thread Bas Scheffers

AFAIK, following instructions:

geefive:~/dev/src/tcl8.4.13/unix bas$ ./configure --prefix=/Users/bas/ 
dev/aolserver-4.5.0 --enable-threads

geefive:~/dev/src/tcl8.4.13/unix bas$ make install

geefive:~/dev/src/aolserver-4.5.0 bas$ /Users/bas/dev/aolserver-4.5.0/ 
bin/tclsh8.4 ./nsconfig.tcl

geefive:~/dev/src/aolserver-4.5.0 bas$ make install

Make and GCC details:

geefive:~/dev/src/aolserver-4.5.0 bas$ make -v
GNU Make 3.80

geefive:~/dev/src/aolserver-4.5.0 bas$ gcc -v
Using built-in specs.
Target: powerpc-apple-darwin8
Configured with: /private/var/tmp/gcc/gcc-5341.obj~1/src/configure -- 
disable-checking -enable-werror --prefix=/usr --mandir=/share/man -- 
enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg] 
[^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with- 
slibdir=/usr/lib --build=powerpc-apple-darwin8 --host=powerpc-apple- 
darwin8 --target=powerpc-apple-darwin8

Thread model: posix
gcc version 4.0.1 (Apple Computer, Inc. build 5341)


Cheers,
Bas.

On 5 Jul 2006, at 20:40, Nathan Folkman wrote:


How are you building Tcl and AOLserver?

- n

[EMAIL PROTECTED] wrote:

Oh boy, another OS X build problem from me... :(

-
ranlib: can't open file: /Users/bas/dev/aolserver-4.5.0/lib/ 
libnsthread.a (No such file or directory)

make[1]: *** [install-dll] Error 1
make: *** [install-bins] Error 1
geefive:~/dev/src/aolserver-4.5.0 bas$ ls /Users/bas/dev/ 
aolserver-4.5.0/lib
libnsthread.dylib   libtcl8.4.dylib  
libtclstub8.4.a tcl8.4  tclConfig.sh

geefive:~/dev/src/aolserver-4.5.0 bas$
-

As you can see, this is a ".dylib" on OS X.

Anoyone seen this before and/or have a fix?

Cheers,
Bas.


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

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



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

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



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

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


[AOLSERVER] Building 4.5 on OS X - .dylib vs. .a

2006-07-05 Thread Bas Scheffers

Oh boy, another OS X build problem from me... :(

-
ranlib: can't open file: /Users/bas/dev/aolserver-4.5.0/lib/ 
libnsthread.a (No such file or directory)

make[1]: *** [install-dll] Error 1
make: *** [install-bins] Error 1
geefive:~/dev/src/aolserver-4.5.0 bas$ ls /Users/bas/dev/ 
aolserver-4.5.0/lib
libnsthread.dylib   libtcl8.4.dylib  
libtclstub8.4.a tcl8.4  tclConfig.sh

geefive:~/dev/src/aolserver-4.5.0 bas$
-

As you can see, this is a ".dylib" on OS X.

Anoyone seen this before and/or have a fix?

Cheers,
Bas.


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

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


Re: [AOLSERVER] build nsd w/o locking?

2006-07-03 Thread Bas Scheffers

On 3 Jul 2006, at 11:35, John Buckman wrote:
No, but on the other hand, most interactive web sites have response  
times over 3 seconds.  Amazon, for instance, now is frequently >10  
seconds for a book page load.  Yahoo, with it's page times  
consistently under 1 second, is a pleasure to use.
Yeah, that is ridiculous. I think with Amazon a fair bit of time is  
also lost rendering the horrific HTML and Javascript they use, so the  
page actually generates faster than you see it. Just nice and clean  
(X)HTML with a good CSS style sheet is the way to go.


questions you will hear is "how do you scale". Engineering for  
scalability way beyond your current needs really will help sell  
your business (I've sold two web-based businesses, and have been  
through discussion this quite a few times)
Yup! I wouldn't mind sativo.co.uk to be sold at some point, so that  
was very important. As was internationalization; it can speak as many  
langauges as you want and run unlimited amounts of country and/or  
white-label sites.


Too many "newbies" also mix their HTML and code way to much. I know  
my "profile" page is a relative biggie; about 5 different tables are  
queried to build it up. Because I program everything in API style,  
there is one procedure that gets the profile based on the ID and  
returns an ns_set with all the data. This then gets passed to the  
procedure that generates the HTML. So there is nothing stopping me  
from caching a serialized version of this ns_set in a BDB and using  
that. The "profile.adp" page wouldn't change, nor would the HTML  
procedure. Just develop the cached "getter" and swap it out...


There's a C client-side module for Lucene, which I assume could be  
fairly easily integrated into a Tcl module. However, I believe the  
server-side is Java, which many are biased against.
I am not biassed against Java, just against lazy-assed EJB abusers  
that think having a "pluggable storage back-end" is more important  
than knowing how to use a database... ;-)


There really is not much reason for a Java-based database (full-text,  
relational, b-tree or any other) to be significantly slower than a  
proper OO C++ based one. Highly efficient C code is another matter,  
though.


One of my colleagues is now using Lucene to index a massively growing  
corporate instant messaging (with word, etc attachments, thank you)  
and is having great results with gigabyte indexes on an overworked,  
shared, development box. It's probably one of the few technically  
sound Apache/Jakarta projects! :D


scenario.  Typically, people use fancy load-balancing machines that  
send the same user to the same machine every time, which is more  
complicated that I like.
Yeah, plus it takes away fail-over. If you have 1000 customers  
hitting one server and it falls over, that is 1000 customers annoyed  
their shopping cart just emptied out...


In such a situation I would opt for a pair of machines that do  
nothing more than store the sessions and replicate them; all in BDB.  
Front-end web servers get a session ID and just retrieve it from  
these back-end caches.


DJ Bernstein (of qmail fame) wrote a read-only database library  
that's insanely fast, about 3x faster than bdb in my own tests,  
which could be useful in certain scenarios.
It's probably the perfect back-end for a search engine that gets  
periodic updates, like Google, where on big index is created off-line  
and then stored on all the machines come roll-out time. (of course  
theirs is chopped into pieces and multiple machines each get a  
different chunk)


I am definitely going to have a play with ns_berkelydb soon, I should  
know more about it! Also eagerly awaiting nsdci!


Cheers,
Bas.


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

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


Re: [AOLSERVER] build nsd w/o locking?

2006-07-03 Thread Bas Scheffers
John Buckman said:
> to AOLServer scalability and the ns_bdb module (which works very well).
That's good to know, I may have some use for it.

> 1) scripting overhead, esp as the application matures and more and
> more dependent code gets included on each page load
How do you mean "included"? Actual code that is run? One of the things
where AOLserver completely blows PHP out of the water is that PHP has to
re-interpret everything on every page. So if you include a library and
only use one function from it... AOLserver's library Tcl code is just
there at no extra cost, other than at thread creation.

> platform, at about 1/2 the speed of serving 1k GIFs, but about 10x
> faster than PHP, 3x faster than lighthttpd-fastcgi.  So, AOLserver is
How could that be, PHP is better than anything, its popular for a reason! ;-)

That's good info, though. I still plan to do my own benchmarks, with some
simulated application so the database and it's drivers get benched too.
Not sure if I will ever get around to it, though.

> a good platform as far as scripting scalability is concerned, as long
> as the developer takes care not to load too much dependent code per
As I said becfore I am not clear about what you mean by this, can you
elaborate?

> end of the table, which is a common scenario.  In my experience, many
> applications that use SQL actually only need key-lookup capability
I guess the answer here is "it depends"; rendering news.bbc.co.uk could be
done from BDB. But people end up wanting to do queries like "how much
money does the average customer spend per month" that only an RDBMS can
provide easily. And the "R" in RDBMS is quite important too. I think the
best use for BerkeleyDB is as a cache; save to the RDBMS, then export to
Berkeley. Like saving all the fields in a blog entry, then rendering the
page and stuffing it in a BerkeleyDB for viewing.

> that it's tricky to get right.  Google uses Berkeley DB for their
> universal login, for just this reason.
It's extremely usefull for that. Though many sites don't quite need to
scale to Google-esque proportions.

> Thirdly, you'll notice many sites have very poor full text searching
> performance.  Lucene, a recently popularized full text search engine,
> appears to finally solve this problem. However, in my case I wanted
But Lucene is probably hard to integrate unless you use Java, isn't it? I
had a play with http://xapian.org/ two years ago. Seems very good, it'd be
nice to have an AOLserver module for it. Some day, when I have time...

> I know that going with Berkeley DB is controversial, but in my
> opinion it's extremely difficult to scale up a SQL backed application
Like I said, I would use DBD as a cache and store the "real data" in a
nice relational schema. But maybe that's just my apprehension with a
technology I haven't used beyond some experiments...

> db platform and do extensive up-front design work to that effect,
> which few people do.
And those are the magic words. Most people don't, they just care about
functionality; "it works, I am done." I am just finsihing up on a service
(http://www.sativo.co.uk) where search is very important. I know that even
with high concurrency it will do 20 searches/sec on the current hardware
with 100K subscribers. I also designed in seperate pools for reading and
writing, so if I do need to scale to multiple DBs, I can use a simple
single master, multiple slaves setup with every web server reading from
their own DB and writing to the master. Due to the low number of writes on
this service, that will scale very well.

> Just my opinion... all I can say is that AOLServer+berkeley-db, if
> you can live with a key-lookup database only, is incredibly fast, at
No surprise there really, AOLserver is the fastest server and BDB is
pretty much the fastest thing out there for key/value lookups!

Cheers,
Bas.


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

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


[AOLSERVER] The Right Tools (was: Re: [AOLSERVER] build nsd w/o locking?)

2006-07-03 Thread Bas Scheffers
Tom Jackson said:
> I think that there are developers who are not familiar or comfortable with
> SQL
> and database management systems. This can lead to a number of bad choices
This seems to be a big problem everywhere. I didn't realize quite how bad
it was in our company until just two weeks ago with two very bad gaffes.
Developers seem to think of the database a "just somewhere to store your
app's data" rather than seeing it as the core of their application.

Pretty soon I am going to do a talk on this. It won't be enough to teach
people all they need to know, but at least it should wake them up and
realize that they do not know enough.

The saddest part is that most of our devs are top-marks grads from
London's top CS program. (Imperial College) And even though probably 90
percent of this uni's grads end up working with RDBMSs and SQL in the
companies they join, the universities just don't seem to have any
(comprehensive) courses on the subject.

They know how to - and spend time on - making their Java code go from 3ms
executiong time to 2.5ms, but not how to make a 2 minute query run in 30ms
just by creating the right indexes and slightly modifying their query...
("Well, it's slow now because there are 10 *THOUSAND* rows in the table!")

> other type of cache. Until traffic develops, it is hard to predict where
> the
> slow points will show up, but putting data into a key-value system from
You should be able to for most things, really. Plus it's pretty easy to
from the start of development fill your database with a lot of dummy data
and run your queries against that.

You are very right on "premature optimization"; there certainly is a time
and place for solutions like BerkeleyDB, but most applications should be
absolutely fine with an RDBMS, proper data design, indexes, queries and
caching. The latter especially for things like the mentioned "static
data"; in a properly normalized database, it is much more efficient to
lookup the "hair_color_id" and "drinking_habits" in an nsv, rather than
joining the profile table on the "hair" and "drinking" tables, and who
knows what other referenced tables.

My soon-to-lauch http://www.sativo.co.uk/ has a couple of one-to-many
relations between the profile table and the tables that store people's
prefered gym activities and workout times and a few other things. Joining
these in the search as most people would do is incredibly slow. Instead, I
turned all these entries into a string like "act_cardio act_weights
time_early_evening time_sun_morning", etc. Indexing this using tsearch2 in
Postgres and doing a full text query makes it fly. As addedd bonus I get a
"fuzzy" search (not all have to match) and the more match, the higher the
ranking.

I would say this could work very well for many other applications too,
just something to think about whenever you end up creating a service that
does any searching/matching; just becuase there isn't any text to index,
doesn't mean that a full-text indexer isn't the right tool!

Bas.


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

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


Re: [AOLSERVER] Problem building nspostgres on Mac

2006-06-30 Thread Bas Scheffers

On 30 Jun 2006, at 22:04, Dossy Shiobara wrote:

Where's the -lnsdb ... ?
Well spotted. Just looked at the makefile; it only puts it in if  
AS3=1. Not sure where that is supposed to come from  
(Makefile.global?) but if I put it in always, it links just fine.


Cheers,
Bas.


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

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


[AOLSERVER] Problem building nspostgres on Mac

2006-06-30 Thread Bas Scheffers

Hi,

Just trying to make nspostgres work on Mac OS X. Any ideas? See  
output below.


Cheers,
Bas.

geefive:~/dev/src/nspostgres-4.0 bas$ make POSTGRES=/usr/local/pgsql/  
INST=/Users/bas/dev/aolserver-4.0.10
gcc -pipe -DBIND_EMULATION -I/usr/local/pgsql//include -Os -Wall -Wno- 
implicit-int -fno-strict-aliasing -fno-common  -I/Users/bas/dev/ 
aolserver-4.0.10/include -I/Users/bas/dev/aolserver-4.0.10/include  - 
DNO_CONST  -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 - 
DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 - 
D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 - 
DHAVE_PTHREAD_ATFORK=1 -DTCL_THREADS=1 -DHAVE_COREFOUNDATION=1 - 
DHAVE_LIBKERN_OSATOMIC_H=1 -DHAVE_OSSPINLOCKLOCK=1 -DHAVE_COPYFILE=1 - 
DMAC_OSX_TCL=1 -DUSE_VFORK=1 -DTCL_DEFAULT_ENCODING=\"utf-8\" - 
DTCL_LOAD_FROM_MEMORY=1 -DTCL_WIDE_INT_TYPE=long\ long - 
DWORDS_BIGENDIAN=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 - 
DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 - 
DHAVE_WAITPID=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 - 
DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 - 
DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_ST_BLKSIZE=1 - 
DSTDC_HEADERS=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_PUTENV_THAT_COPIES=1 - 
DHAVE_LANGINFO=1 -DHAVE_FTS=1 -DHAVE_SYS_IOCTL_H=1 - 
DHAVE_SYS_FILIO_H=1   -DTCL_CFG_OPTIMIZED=1 -DTCL_CFG_DEBUG=1 - 
DHAVE_INTTYPES_H=1 -DHAVE_TIMEGM=1 -DHAVE_POLL=1 -DHAVE_DRAND48=1 - 
DHAVE_RANDOM=1 -DHAVE__NSGETENVIRON=1 -DUSE_DYLD=1 -DHAVE_CMMSG=1 - 
DHAVE_GETADDRINFO=1 -DHAVE_GETNAMEINFO=1 -DHAVE_ZLIB_H=1 - 
DHAVE_LIBZ=1-c -o nspostgres.o nspostgres.c

/bin/rm -f nspostgres.so
cc -bundle -L/Users/bas/dev/aolserver-4.0.10/lib -o nspostgres.so  
nspostgres.o -L/usr/local/pgsql//lib -lpq -lnsthread -lnsd -L/Users/ 
bas/dev/src/tcl8.4.13/unix -ltcl8.4   -lpthread -framework  
CoreFoundation   -lz

/usr/bin/ld: Undefined symbols:
_Ns_DbDriverName
_Ns_DbRegisterDriver
_Ns_DbSetException
_Ns_TclDbGetHandle
collect2: ld returned 1 exit status
make: *** [nspostgres.so] Error 1


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

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


Re: [AOLSERVER] Unix vs. Windows build environments

2006-06-30 Thread Bas Scheffers
Jamie Rasmussen said:
> For my nightly AOLserver build I use Visual C++ Toolkit 2003.  The
> Toolkit is command-line only but free-to-download.  In my opinion that's
> enough to make it the preferred compiler for now.  I have a TCL script
Isn't the code the free one produces not quite as optimized as the full
version?

What about http://openwatcom.org/ ? IIRC Watcom used to be the bees knees
back in the days. What are people's opinions of it? It'd be interesting to
see if there is a performance difference between these two free (as in
beer) compilers. Watcom seems a bit more free (as in speech) as well.

> Now that AOLserver 4.5 has been released, maybe we can get a simple
> installer together and upload it to SourceForge.  I imagine that's the
> format most prospective win32 users want.
Sounds like a plan. But what about the DB drivers? I guess that most would
install databases using their respective installers and put them in
default locations as well, so I guess it'd be safe to provide dynamically
linked Postgres and MySQL drivers.

Bas.


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

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


Re: [AOLSERVER] 404 redirect

2006-06-21 Thread Bas Scheffers
John Buckman said:
> I'm trying to redirect "404 not found" pages to the home page.  The
> annotated config file shows this as:
Are you sure you want to do this? This is very confusing for users! I
personally hate this when I come acros a site that does it. I much prefer
a 404 page with link to the homepage and also a link to support pages
where they might tell you of the problem.

> but this isn't having any effect for me.  Can someone suggest how to
None at all? (ie: you still get the simple/default 404 message) Or does it
show the homepage but with the same URL as before? These are internal
redirects, so they should show the contents of index.adp, but the URL
doesn't change; the server does NOT send a 301/302 redirect to the
browser.

> go about debugging the problem?  Alternatively, is there a Tcl
> command to do this?
Well, Tcl is only run on pages (or registered procs) that can be found, so
no, you can't. :)

Cheers,
Bas.


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

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


Re: [AOLSERVER] Less than virtual

2006-06-03 Thread Bas Scheffers

On 3 Jun 2006, at 00:56, William Scott Jordan wrote:
personal website.  For the most part, this just means that we need  
to change the style sheet and use Company X's URL instead of our  
own.  Because we could be looking at potentially thousands of  
clients wanting to do this and because 99.9% of the site would remain
That's what I do on my new site. (well, it's a bit more elaborate  
than just a stylesheet, but it is Host header based) So yeah, that is  
a good way of doing things.


And then the bigger question is, is there any way to tell AOLserver  
which SSL cert to use, based on the host information?
I don't think any server available can do that, for reasons already  
explained. I would register some generic domain name, get a domain  
level ("wildcard") cert for it and when your sites do switch to  
secure for final checkout, send them to https:// 
sitname.genericdomain.com.


If you are indeed talking about 1000s of sites, it may be worth it to  
look into some hardware crypto box that is able to serve that many  
different domains with a seperate cert each, without having to run  
thousands of nsd processes. But you would still need one IP per site  
to make it work.


Cheers,
Bas.


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

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


Re: [AOLSERVER] Something wrong after 2006-05-12 21:25 (was Re: Weird "memory leak" problem in AOLserver 3.4.2/3.x)

2006-05-17 Thread Bas Scheffers

On 17 May 2006, at 21:34, Dossy Shiobara wrote:

Dave Siktberg seems to have narrowed it down to 2006-05-12 21:25.
In what timezone? It sound like that could equate to "Sat May 13  
02:27:28 BST 2006", or 1147483648 seconds since epoch, which makes it  
*exactly* 1,000,000,000 seconds until expiry of 32 bit time.  
Coincidence? Seems too strange as to a computer that is not a nice  
round number.


I wonder what Dan Brown would have to say about it! :)

Bas.


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

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


Re: [AOLSERVER] Debian build problems

2006-05-09 Thread Bas Scheffers
Thanks everyone for responing, the patch did the trick.

Cheers,
Bas.

Rick Gutleber said:
> Jeremy's right.  It's technically a syntax error that 3.x lets slide,
> but 4.0 complains about.  The change to get rid of the error is this:
>
> < connPtr = (Conn *) conn = itPtr->conn;
> ---
>  > conn = itPtr->conn;
>  > connPtr = (Conn *) conn;
>
> Rick
>
> Jeremy Collins wrote:
> > Make sure you're building not building with gcc 4.0, maybe try 3.3 or
> > 3.4.
> >
> > On May 9, 2006, at 9:06 AM, Bas Scheffers wrote:
> >
> >> Hi,
> >>
> >> Just trying to setup AOLserver on a debian box. Tried several version
>>> of
> >> Tcl and AOLserver (including the 8.4.9/4.0.9 I have working elsewhere
> >> on a
> >> Fedora box) but always the same problem:
> >>
> >> conn.c: In function 'NsTclConnObjCmd':
> >> conn.c:843: error: invalid lvalue in assignment
> >> make[1]: *** [conn.o] Error 1
> >>
> >> Does anyone have any ideas? CVS HEAD does build, but this is supposed
>>> to
> >> be a production box, so I don't really want to run that yet.
> >>
> >> Cheers,
> >> Bas.
> >>
> >>
> >> --
> >> AOLserver - http://www.aolserver.com/
> >>
> >> To Remove yourself from this list, simply send an email to
> >> <[EMAIL PROTECTED]> with the
> >> body of "SIGNOFF AOLSERVER" in the email message. You can leave the
> >> Subject: field of your email blank.
> >>
> >
> >
> > --
> > AOLserver - http://www.aolserver.com/
> >
> > To Remove yourself from this list, simply send an email to
> > <[EMAIL PROTECTED]> with the
> > body of "SIGNOFF AOLSERVER" in the email message. You can leave the
> > Subject: field of your email blank.
> >
>
>
> --
> AOLserver - http://www.aolserver.com/
>
> To Remove yourself from this list, simply send an email to
> <[EMAIL PROTECTED]> with the
> body of "SIGNOFF AOLSERVER" in the email message. You can leave the
> Subject: field of your email blank.
>


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

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


[AOLSERVER] Debian build problems

2006-05-09 Thread Bas Scheffers
Hi,

Just trying to setup AOLserver on a debian box. Tried several version of
Tcl and AOLserver (including the 8.4.9/4.0.9 I have working elsewhere on a
Fedora box) but always the same problem:

conn.c: In function 'NsTclConnObjCmd':
conn.c:843: error: invalid lvalue in assignment
make[1]: *** [conn.o] Error 1

Does anyone have any ideas? CVS HEAD does build, but this is supposed to
be a production box, so I don't really want to run that yet.

Cheers,
Bas.


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

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


[AOLSERVER] No Makefile.module in cvs

2006-05-07 Thread Bas Scheffers
Just playing with with CVS version, but when trying to build  
nspostgres I noticed there is no Makefile.module anymore.


Is this a bug or a new feature the nspostgres driver hasn't been  
updated for yet?


Cheers,
Bas.


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

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


Re: [AOLSERVER] build nsd w/o locking?

2006-04-18 Thread Bas Scheffers
John Buckman said:
> 440 hits/s second is plenty fast, amazing even (fyi, compared to
> about 12 hits/s I get if I code the same page in MySQL), I was just
What kind of SQL/code is that? And what kind of server? I get 100+
pages/sec using AOLserver and Postgres for a message board system; two
seperate queries both joining two tables and searching on well-indexed
keys. (Sempron 2800+, 512MB, Linux, ATA)

I don't see why you should get any less performance from your book sharing
service, which, I asume, also is mostly key lookups. All without the
hassle of Berkely DB.

There is a time and place for Berkeley DB for sure, but to me it sounds
like you are now making things hard on yourself for the sake of "premature
optimization"! :)

Cheers,
Bas.


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

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


Re: [AOLSERVER] build nsd w/o locking?

2006-04-18 Thread Bas Scheffers
John Buckman said:
> Because BerkeleyDB's tcl interface isn't thread safe, I'm running
> aolserver in single-thread mode, with
You need to look into "environments" in the Berkely DB system. The way I
see it, you should be able to have concurrent access to one database from
many threads in AOLserver.

Cheers,
Bas.


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

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


Re: [AOLSERVER] Databases (was : The quality of our community (was Re: [AOLSERVER] Retrieving oid from INSERT))

2006-04-10 Thread Bas Scheffers
Mat Kovach said:
> I see many large scale sites that run UDB/DB2.  I know of at least three
> sites that have, easily, 1000 UDB instances running.  I lot of people
What kind of sites are they? What industries?

Cheers,
Bas.


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

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


  1   2   3   4   >