The TclHttpd Distribution
Get the TclHttpd distribution from the CD-ROM, or find it on the Internet at:
Unpack the tar file or the zip file, and you can run the server from the httpd.tcl script in the bin directory. On UNIX:
tclsh httpd.tcl -port 80
This command will start the Web server on the standard port (80). By default it uses port 8015 instead. If you run it with the -help flag, it will tell you what command line options are available. If you use wish instead of tclsh, then a simple Tk user interface is displayed that shows how many hits the server is getting.
On Windows you can double-click the httpd.tcl script to start the server. It will use wish and display the user interface. Again it will start on port 8015. You will need to create a shortcut that passes the -port argument, or edit the associated configuration file to change this. Configuring the server is described later.
Once you have the server running, you can connect to it from your Web browser. Use this URL if you are running on the default (nonstandard) port:
If you are running without a network connection, you may need to specify 127.0.0.1 for the hostname. This is the "localhost" address and will bypass the network subsystem.
Inside the Distribution
The TclHttpd distribution is organized into the following directories:
This has sample start-up scripts and configuration files. The httpd.tcl script runs the server. The tclhttpd.rc file is the standard configuration file. The minihttpd.tcl file is the 250-line version. The torture.tcl file has some scripts that you can use to fetch many URLs at once from a server.
This has all the Tcl sources. In general, each file provides a package. You will see the package require commands partly in bin/httpd.tcl and partly in bin/tclhttpd.rc. The idea is that only the core packages are required by httpd.tcl, and different applications can tune what packages are needed by adjusting the contents of tclhttpd.rc.
This is a sample URL tree that demonstrates the features of the Web server. There is also some documentation there. One directory to note is htdocs/libtml, which is the standard place to put site-specific Tcl scripts used with the Tcl+HTML template facility.
There are a few C source files for a some optional packages. These have been precompiled for some platforms, and you can find the compiled libraries back under lib/Binaries in platform-specific subdirectories.