How to call .tcl scripts from an HTML file

Philip Greenspun's Homepage : Philip Greenspun's Homepage Discussion Forums : Ask Philip : One Thread
Notify me of new responses
So basically, I've just started running through 6.171 about one/two
weeks ago and spent basically all that time setting everything up (and
I'm still not sure if everything's right because I had some problems
with the oracle8i setup instructions since oracle10g is used now).

Anyways, my problem now is that I don't think I'm calling the .tcl
scripts right :/ I got stuck on exercise 3 in Basics which is
basically recreating the lens tcl script. I think there's something I
need to do with the configuration script for AOLserver because right
now when I open say "lenstest.tcl" from a form, the page that I get is
an html page with the source code typed out. Instead of executing the
instructions, it's just displaying the text. I looked at AOLserver
documentation and they mentioned putting tcl scripts in libraries and
then changing the configuration file somehow to execute those tcl
scripts. But the instructions in "Basics, exercise 3" said to save the
.tcl file in the same place as the .html file. Can you give me some
advice? THANKS!

-- David Lee, February 4, 2006


Whoa. AOLserver! That is old school. I'm impressed. AOLserver by default doesn't do anything special with *.tcl files. So they end up getting served with the default MIME type (text/plain is my preference, but I think the server comes configured with text/html). You end up needing one file in the .tcl library (loaded at server startup) that registers *.tcl URLs to be interpreted. In AOLserver 4.x, I believe that this is found in /home/nsadmin/modules/tcl/file.tcl (might be commented out or disabled).

You'll probably get better support from the forums at; I personally haven't had to install an AOLserver in a long time (though of course I am still using it on several sites).

(Also make sure that you check out the ADP features of AOLserver; this is mostly what AOL itself uses.)

-- Philip Greenspun, February 4, 2006

Try setting enabletclpages to true in the ns/server/${servername} section of the configuration file.

-- Andrew Grumet, February 4, 2006

Thanks to both of you for your help! I have another question now...

"I personally haven't had to install an AOLserver in a long time (though of course I am still using it on several sites)." -philip

Since I'm just starting up in the websiting arena, I want to start off learning to use the "best" things so I won't have to keep switching around because I remember you said in the text that once you've already learned something, just stick with it. So my question is, is AOLserver still the best or a very good choice for running a server for a community website? (one that would use RDBMS a lot). What I gathered from reading was that AOLserver was very efficient for that type of website. I also concluded that Apache was good mostly for hosting smaller websites? Since it's been a couple of years since those texts were written, do you still suggest AOLserver? (I got a strong impression of AOLserver when reading all your texts).

I guess a followup question is regarding Oracle10g vs. PostgreSQL. Through reading, I mostly got the impression that Oracle was a good choice for databasing because of its popular and ability to get support. Also something about PostgreSQL not being able to support the 'C' part of ACID compliant databasing. Is that still applicable now? (several years after). The original reason I chose Oracle was because the examples in your text were for Oracle and since I'm new, I thought it'd be easier to start off that way. However, it seems like PostgreSQL might be easier to install and maintain. Also, OpenACS seems to be leaning towards PostgreSQL (I even read an announcement of how people were thinking about dropping oracle support). Thanks!!

-- David Lee, February 5, 2006

AOLserver, OpenACS, Oracle, PostgreSQL

David, I like AOLserver, and once I started doing C hacking in it I was even more pleased. I also like OpenACS, and I'm not aware of any other web framework as capable. Now, I don't have the time to actively investigate all the various web frameworks and tools constantly popping up, so I could have missed something better, but I do keep an eye and ear out.

Among other things, the OpenACS emphasis on a good integrated data model is very valuable, yet still seems to be quite unusual. (Although he overdid it at times, Philip was always right to stress the importance of the data model.)

PostgreSQL has had very good concurrency for a long, long time, probably since they added MVCC sometime in the late 1990's.

Oracle and PostgreSQL are both excellent, and solely on their technical merits (ignoring the money), Oracle and PostgreSQL each have advantages and disadvantages, neither is across the board superior in all ways. You aren't likely to go wrong choosing either one, but the simplest answer is, if you don't know exactly why you should use Oracle, don't, use PostgreSQL instead. Since PostgreSQL is open source, costs nothing, and is generally easier to set up and get working, it should be your default choice.

-- Andrew Piskorski, February 5, 2006

Can PostgreSQL support large #s of users?

"PostgreSQL is easy to install and administer, but is not used by operators of large services because there is no way to build a truly massive PostgreSQL installation or one that can tolerate hardware failures."

This is a quote from the Basics section of SEIA. Is it still applicable now? Could you run something like on PostgreSQL that supports half a million users?

-- David Lee, February 5, 2006