Home

Lesson 1: Server Setup

12:06 PM Learn | Basic Setup | Templates | Server Security | Direct URLs | URL Domains

Out of Box Startup

This page describes how to set up the server for a standard "web page server" and as a platform for web applications. You have probably started the server using this simple command:
tclsh8.5 bin/httpd.tcl -debug 1
This runs the server using a standard selection of features and displaying the documents stored under htdocs in the distribution. If you want an alternate document root, use the -docRoot directory command line option.
tclsh8.5 bin/httpd.tcl -docRoot directory

When you specify the -debug flag, you get additional information printed as different modules are loaded. You also get a Tcl command prompt that lets you poke around in the main Tcl interpreter used by TclHttpd.

Here are the command line options understood by this server:
optiondefaultdescription
-virtualVirtual host config list
-config/home/obs-utl/999A-UTLS/WebServices/tclhttpd3.5.1/bin/tclhttpd.rcConfiguration File
-main/home/obs-utl/999A-UTLS/WebServices/tclhttpd3.5.1/bin/httpdthread.tclPer-Thread Tcl script
-docRoot/home/obs-utl/999A-UTLS/WebServices/tclhttpd3.5.1/bin/../htdocsRoot directory for documents
-port8015Port number server is to listen on
-hostsuperbeanServer name, should be fully qualified
-ipaddrInterface server should bind to
-https_port8016SSL Port number
-https_hostsuperbeanSSL Server name, should be fully qualified
-https_ipaddrInterface SSL server should bind to
-webmasterdl@obs-now.comE-mail address for errors
-uid50User Id that server runs under
-gid50Group Id for caching templates
-secs60Seconds per "minute" for time-based histograms
-threads0Number of worker threads (zero for non-threaded)
-library/home/obs-utl/999A-UTLS/WebServices/tclhttpd3.5.1/bin/../customDirectory list where custom packages and auto loads are
-debug0If true, start interactive command loop
-compat3.3version compatibility to maintain
-gui1flag for launching the user interface
-mailMail Servers for sending email from tclhttpd

Adding Code

The server automatically sources the code in its custom code directory, which is specified by the -library command line argument. This feature allows you to "drop in" additional Tcl code without modifying the server. Your code can turn the basic server into a complete application.

The sampleapp directory of the distribution contains several examples contributed by TclHttpd users.
HomeStatusLearnCGI TestsTemplatesAccess ControlReference Manual