gunzip apache-1.3.X.tar.gz
tar -xvf apache-1.3.X.tar.gz
You don't need the Apache sources if you are building a shared
object module. You do, however, need the header files.
Some systems, such as Debian GNU/Linux, provide these
independently - otherwise, you probably still need the sources.
gunzip mod_dtcl-X.X.X.tar.gz
tar -xvf mod_dtcl-X.X.X.tar.gz
Note: if you have a threaded Tcl, you may wish to modify the relevant section of mod_dtcl.h, which changes mod_dtcl to work properly with a threaded Tcl.
cd ../mod_dtcl/
Edit the builddtcl.sh script. The 3
variables you may need to change are:
TCLSHAPACHEINC
./builddtcl.sh shared
cp mod_dtcl.so
/usr/lib/apache/wherever/the/other/shared/objects/reside
For shared object builds, you need to copy the
object into the directory where the other shared
objects are kept for your Apache build. On Debian
GNU/Linux systems, for instance, this is in
/usr/lib/apache/1.3/.
cd apache-1.3.X/
./configure
cd ../mod_dtcl/
Edit the builddtcl.sh script. The 3
variables you may need to change are:
TCLSHAPACHEINC
./builddtcl.sh static
./builddtcl.sh install
cd ../apache-1.3.X
./configure
--activate-module=src/modules/mod_dtcl/mod_dtcl.a [ other configure
options ]
export EXTRA_LIBS="-ltcl8.X -lm"make -e
make install
LoadModule dtcl_module
/usr/lib/apache/1.3/mod_dtcl.soAddModule mod_dtcl.c seems to
also have positive effects.
AddType application/x-httpd-tcl .ttmlAddType application/x-dtcl-tcl .tcl
(optional)Dtcl_Script GlobalInitScript "script""script" is actual Tcl
script, so to run a file, you would do
Dtcl_Script GlobalInitScript "source /var/www/foobar.tcl".
Dtcl_Script ChildInitScript "script"Dtcl_Script ChildExitScript "script"Dtcl_Script BeforeScript "script"hputs in the BeforeScript, but must
instead use buffer_add.
Dtcl_Script AfterScript "script"Dtcl_Script ErrorScript "script"Dtcl_CacheSize cachesizeDtcl_UploadFilesToVar on/offDtcl_SeperateVirtualInterps
on/offbuffer_add stringhputs ?-error? textvarvar get varnamevar list varnamevar exists varnamevar numbervar alluploadUPLOAD variable.
upload get varname channelupload get varname save nameupload get varname dataupload info varname existsupload info varname sizeupload info varname typeupload info varname filenameupload nameshgetvarsENVS, CLIENT_ENVS and
COOKIES are the associative arrays created. ENVS contains
environmental variables. CLIENT_ENVS contains the headers received from the client.
COOKIES contains any cookies
received from the client.
include filenameparse filenamehflushheaders redirect uriheaders setcookie -name cookie-name
-value cookie-value ?-expires date/time? ?-domain domain?
?-path path? ?-secure?headers type
content-typeheaders set headername valuemakeurl filenamemakeurl /tclp.gif returns
http://[hostname]:[port]/tclp.gif.
dtcl_infotcl_init_stuff is called, which creates
a new interpreter, and initializes various things,
like the apache_channel channel system.
The caching system is also set up, and if there is a
GlobalScript, it is run.
send_parsed_file Each .ttml file is
loaded and run within its own namespace. No new
interpreter is created for each page. This lets you
share variables, and most importantly, loaded modules,
from a common parent (such as one of the InitScripts).
When a file is loaded, it is transformed into a Tcl
script by putting everything outside of <? and
?> into large hputs statements. When the script is
complete, it is then inserted into the cache, for
future use. In fact, if the file modification
information doesn't change, mod_dtcl will execute the
cached version of the script the next time it is
encountered.
USE_OLD_TAGS is set to 0 in
mod_dtcl.h. You can automatically change your
.ttml files to the new format by using the
newtags.sh script in the contrib/ directory.
Run it at the top level of your DocumentRoot.
headers setcookie command now uses the
-name and -value flags for those
arguments, whereas this was not necessary in the past.