From time to time, I'm working on a starpack based on tclhttpd v 3.5.1 which can be run as a Windows Service through the help of Winserv. Additional descriptions are at the bottom and some more probably will be added later.
However, the starpack can be run as a normal program too, not only as a service.
You can download it here: http://home.arcor.de/hoffenbar/prog/tclhttpd.zip (64bit Testversion: [L1 ])
Example cmdline help: (note that it may differ from release to release and from environment to environment as some defaults like paths are constructed dynamically)
tclhttpd.exe 0.85, based on tclhttpd 3.5.1 and Tcl 8.4.19, modified 24.11.2008 22:41:52, MHo usage: tclhttpd.exe {[options]|scriptfile} -virtual value Virtual host config list <> -config value Configuration file <D:/Home/Arbeit1/pgm/tcl/usr/Src/httpd351pack4/tclhttpd.exe/bin/tclhttpd.rc> -main value Per-Thread Tcl script <D:/Home/Arbeit1/pgm/tcl/usr/Src/httpd351pack4/tclhttpd.exe/bin/httpdthread.tcl> -docRoot value Root directory for documents <D:/Home/Arbeit1/pgm/tcl/usr/Src/httpd351pack4/tclhttpd.exe/bin/../htdocs> -port value Port number server is to listen on <8015> -host value Server name, should be fully qualified <matthias> -ipaddr value Interface server should bind to <> -https_port value SSL Port number <8016> -https_host value SSL Server name, should be fully qualified <matthias> -https_ipaddr value Interface SSL server should bind to <> -webmaster value E-mail address for errors <webmaster@matthias> -uid value User Id that server runs under <50> -gid value Group Id for caching templates <50> -secs value Seconds per "minute" for time-based histograms <60> -threads value Number of worker threads (zero for non-threaded) <10> -library value Dir list where custom packages and auto loads are <D:/Home/Arbeit1/pgm/tcl/usr/Src/httpd351pack4/tclhttpd.exe/bin/../custom> -debug value If true, start interactive command loop <0> -compat value Version compatibility to maintain <3.3> -gui value Flag for launching the user interface <1> -mail value Mail Servers for sending email from tclhttpd <> -LogFile value Location and name prefix for logfiles <s:/tmp/log> -tclcgi value Runtime to execute tcl-CGIs <C:/Programme/Tcl/bin/tclsh.EXE> -AuthDefaultFile value Location for internal authfile <s:/tmp/tclhttpd.default> -unpacktools Extract included tools and docs -morehelp Show a few background infos -help Print this message -? Print this message
Output of -morehelp
This Webserver is based on tclhttpd v3.5.1 and a tcl runtime (either a tclkit or a basekit ActiveTcl, e.g.). This starpack is designed to run as a Windows service through Winserv. It can be started interactively, too. The VFS-internal htdocs and libs are stripped down somewhat to reduce exe size. They are always available unter /adminroot. The CGI demos will not run out of the VFS! Code from internal custom dir is loaded first. The 'real' custom dir is expected to be outside the VFS, because it's subject to changes all the time. Also, it's likely that you will have your own tclhttpd.rc-Configuration-file. On windows, the auto_path is automatically extended to the lib folder of an existing Tcl installation (auto_execok tclsh/../lib). If there is such an installation, it also runs Tcl-CGIs. If not, tclkitsh is searched. The last fallback is that this program also runs the CGIs. An example for installing this starpack as a service: winserv install httpd1 -ipcmethod stdio -start demand -description "tclhttpd1" -user .\xyz -password abc d:/progs/tclhttpd.exe -config d:/my/httpd.rc -library d:/my/custom winserv start httpd1 tclhttpd.exe is under development, so the .exe will change frequently. things that could be done or should be noticed: - incorporate changes/fixes from later (3.5.2/CVS)-versions - replace the cmdline/config-parsing with Spar and readprof (see wiki) - adapt new homepage (see https://wiki.tcl-lang.org/11420 and http://www.frbc-va.org/mockup/); a dummy is available at /home2.html - create config/tclhttpd.rc equivalents for the newly added cmdline switches - add support for more cgi interpreters (php, ...) (no #!-magic on MS Win) - reimplement PAUSE and CONTINUE functions in a better way, and implement service control e.g. to query several states of the server - eventually add separate event logging for Windows eventlog, and/or reorganize the whole stdout/stderr/console output stuff - (Re-)integration of wikit (whipit), see https://wiki.tcl-lang.org/11121 - look further at https:-Support ! * use the right account for the service; watch the environment, especially ! the PATH-var (additional env-vars could be added through custom code) ! * avoid using backslashes in command line arguments; they are not yet ! automatically translated M.Hoffmann, 2006-2008
(As said, the program will change from time to time and so will this help text.)
To access the build in docs and admin-tools, simply start tclhttpd without any parameters and navigate your browser to localhost:8015. These are always available via url /adminroot even if you have configured your own docRoot (some links may still not work yet).
To implement tclhttpd as a service, you need Winserv, which is available inside tclhttpd.exe an can be extracted via -unpacktools command line switch.
RLH 2006-04-10: Why version 3.4.2 when 3.5.1 is the latest release? MHo I tried 3.5.1 several times and never succeeded in getting it servicing our existing intranet site, driven by 3.4.2/3.4.3 without modifications. It seems to me that there are some changes that are not upward compatible (probably in doc.tcl). I'm working on this. 2006/07/18: v3.5.1 is now the base of my modifications. Remember: Specifying URLs without the .tml-extension only works anymore with documents specifying [Doc_Dynamic]...
History
History for v0.7 and above:
25.10.2007-02.11.2007, v0.7:
25.01.2008, v0.8, MHo (sorry: not tested very well yet):
27.01.2008, v0.81, MHo:
09.07.2008, v0.82, MHo: Time for some changes ;-)
23.09.2008, v0.83, MHo:
20.11.2008, v0.84, MHo:
26.11.2008, v0.85, MHo:
28.11.2008, v0.86, MHo:
29.11.2008, v0.87, MHo:
30.11.2008, v0.88, MHo:
01.12.2008, v0.89, MHo:
04.02.2009, v0.90, MHo:
Glob problem w/tclvfs and Tcl 8.5.*???
Now reported at: http://sourceforge.net/tracker/index.php?func=detail&aid=2378350&group_id=32692&atid=406308
httpd % glob $::starkit::topdir/bin/../custom/* no files matched glob pattern "D:/Home/Hoffmann/pgm/tcl/usr/Src/httpd351pack4/tc lhttpd8.5.5_32.exe/bin/../custom/*"
A workaround would be:
glob -directory $::starkit::topdir/bin/../custom/ *