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
cd ../mod_dtcl/
Edit the builddtcl.sh
script. The 3
variables you may need to change are:
TCLSH
APACHE
INC
./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:
TCLSH
APACHE
INC
./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.so
AddType application/x-httpd-tcl .ttml
AddType 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 cachesize
Dtcl_UploadFilesToVar on/off
Dtcl_SeperateVirtualInterps
on/off
buffer_add string
hputs ?-error? text
var
var get varname
var list varname
var exists varname
var number
var all
upload
UPLOAD
variable.
upload get varname channel
upload get varname save name
upload get varname data
upload info varname exists
upload info varname size
upload info varname type
upload info varname filename
upload names
hgetvars
ENVS
and
COOKIES
are the associative arrays created. ENVS
contains
environmental variables, and COOKIES
contains any cookies
recieved from the client.
include filename
parse filename
hflush
headers redirect uri
headers setcookie -name cookie-name
-value cookie-value ?-expires date/time? ?-domain domain?
?-path path? ?-secure?
headers type
content-type
headers set headername value
makeurl filename
makeurl /tclp.gif
returns
http://[hostname]:[port]/tclp.gif.
dtcl_info
tcl_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.
The mod_dtcl mailing list is the best place to go for help when you have problems.
See the Contact page for information on sending mail/subscribing.
Mailing list archives are also available at http://archive.covalent.net, at the bottom of the page.