From: Colin M. <co...@ch...> - 2005-07-19 04:24:04
|
On Tue, 2005-07-19 at 12:37 +1200, Paul Nash wrote: > I am migrating windows/sambar/activetcl wensites to > linux/tclhttpd/activetcl. (apache proved to limiting) > First stage is to migrate to windows/tclhttpd/activetcl. > This works OK if I rename the *.tcl scripts to *.cgi scripts. > But I figure I should be able to tell tclhttpd to handle the .tcl scripts as > cgis. > Can someone tell me how to do this please. You probably don't want to do that :) Have you looked at template files? They're indicated by the suffix .tml, and the content of the file is run through tcl's subst command. Anyway, it's possible that you could get the effect you desire by: Mtype_Add .tcl application/x-cgi although I really thought that .tcl files were just known and executed ... try moving one under your Doc root instead of under your Cgi root and see what happens if you try loading it (as .html or as .tcl.) The trouble with running tcl as a cgi is that you have to start up another copy of the tcl interpreter executable, whereas a .tml file can just run under the existing interpreter. If you can rewrite your scripts so they return a value instead of writing it to a file descriptor, you can make them .tml files by just enclosing their content in [] Finally, if you're keen, and nothing else works, and you don't want to rewrite the stuff, you could write a proc Doc_application/x-tcl which does whatever you want with .tcl content. Indeed, this extends to any extension you like to use (see the other Doc_application/* procs for some hints on how.) Colin. |