How to turn Brent Welch's Tclhttpd server into a scripted document
- Get the distribution archive from:
http://sourceforge.net/projects/tclhttpd/
- Unpack, and rename the top-level directory to "tclhttpd.vfs":
mv tclhttpd3.3.1 tclhttpd.vfs
- Get the Tcl standard library from:
http://sourceforge.net/projects/tcllib/
- Unpack, and move several required modules to tclhttpd.vfs/lib/:
mv tcllib-1.3/modules/{base64,cmdline,counter,html,ncgi,uri} tclhttpd.vfs/lib/
- Create a file "tclhttpd.vfs/main.tcl" containing:
package require starkit
starkit::startup
package provide tcllib 1.3 ;# fake, because not all pkgs are included
set env(TCL_HTTPD_LIBRARY) [file join $starkit::topdir lib]
source [file join $starkit::topdir bin httpd.tcl]
- Test by running tclhttpd in its unwrapped state:
tclkit tclhttpd.vfs/main.tcl
- Create a starkit from this, using the SDX utility:
sdx wrap tclhttpd
- The tclhttpd.vfs/ directory will be packaged into a file "tclhttpd", now start the server:
tclkit tclhttpd
- To test the server, point your browser to "http://localhost:8015/"
Or simply download tclhttpd as starkit, which is identical to what the above steps lead to:
http://www.equi4.com/pub/sk/tclhttpd.kit
The ".kit" suffix is used to force a binary download - you can drop it. Then "chmod +x" it and you'll have a complete webserver in a single file.
Last modified
2002-11-01
2002-11-01
(local)
Note: you are looking at
the snapshot of an old wiki
- much of this information
is likely to be very outdated
