While developing with Woof!, you can simply directly start Woof! as an SCGI server by directly invoking the Woof! SCGI server script. For example, the following console command in the Woof! root directory c:\myapp
c:\myapp> tclsh lib\woof\webservers\scgi_server.tcl
starts Woof! listening on the default port 9999, or
c:\myapp> tclsh lib\woof\webservers\scgi_server.tcl -port 10000
will start it on a non-default port 10000.
To stop the server, simply hit Ctrl-C.
To run Woof! in production mode, where the Woof! process must be running independently of anybody being logged in, it must be installed as a Windows service using the scripts\scgi_winservice.tcl script. For example,
c:\myapp> tclsh scripts\scgi_winservice.tcl -service woofscgi install
will install Woof! as a Windows service woofscgi. You
can use the standard Windows service control commands, such
as net stop and net start to control the service.
In addition to the service name, you can also set the port and other
parameters. see the scgi_winservice - Woof! Windows Service chapter for
details.
Note you have to make sure the service is started by some means before the web server is ready to pass on requests. There are three possible ways to do this.
net start command.-startup auto
option.
c:\myapp> tclsh scripts\scgi_winservice.tcl -service woofscgi -startup auto install
If your web server is Microsoft IIS and you are using
the isapi_scgi
IIS extension, you can have IIS start the Woof! service
"on-demand". Configure the service to start in manual mode
as above. Then add the following two lines to
the isapi_scgi configuration
file.
SCGIServerStartCommand= net start woofscgi SCGIServerStopCommand= net stop woofscgi
This assumes you have named the Woof! SCGI service
as woofscgi.
The first time that IIS receives a request to be sent to Woof!, it
will load the isapi_scgi extension. As part of its
initialization, the extension will then execute the command specified
by the SCGIServerStartCommand variable to start the Woof!
SCGI server. Similarly, when IIS is stopped, the isapi_scgi extension
will invoke the command specified by
the SCGIServerStopCommand variable to stop the Woof!
service. For more details, see
the isapi_scgi documentation.
If you no longer wish to run Woof! as a service, you can use the scgi_winservice.tcl script to uninstall it:
c:\myapp> tclsh scripts\scgi_winservice.tcl -service woofscgi uninstall
By default, the Woof! service will run under the Windows LocalSystem account. For security reasons, you may want to change to run under a less privileges account. You can do this through the Log on pane in the property sheet for the service in Windows Service Control Manager. If you do this, make sure the account has access to the resources (file system, databases etc.) used by your Woof! application.
Because the Woof! libraries may not be loaded during startup, the Woof! service will log errors to the Windows event log in some cases, particularly during startup.
Woof! Version: 0.4, Server: Apache, Interface: CGI, Tcl: 8.6b1.1