CGI-mode and The Temporary Directory


The most difficult part of the CGI-mode Sawmill installation is choosing the correct Temporary directory and Temporary directory URL. When you run Sawmill in web server mode (with Sawmill running its own internal web server, and serving its pages via HTTP), this step is not necessary, which is one of the advantages of web server mode. However, if you prefer to run Sawmill in CGI mode, you will have to choose the Temporary directory and URL.

Sawmill includes images as part of its output, including pie charts, line graphs, bar charts, and icons. To display these images, it first creates GIF image files in the Temporary directory, and then embeds the URLs of those images in the HTML of the pages it generates, using the Temporary directory URL as the basis for choosing the correct URL.

The Temporary directory and the Temporary directory URL are two different ways of describing the same directory. They must point to the same directory for Sawmill's output to look correct. The temporary directory:

The Temporary directory should be described using your platform's standard pathname format (see Pathnames). The Temporary directory URL should describe the same directory as the Temporary directory, but as a URL (as it might be accessed using a web browser, by browsing the server Sawmill is running under). The following examples illustrate how it might be set for various platforms; see Web Server Information for more specific information.

As the hostname part of the URL, you will need to specify the machine Sawmill is running on. In the examples below, this is chosen to be www.mysys.com; you will need to replace this part of the URL with your machine's actual hostname.

Example 1: For MacOS, if the root of your web server's HTML pages is at /Library/WebServer/Documents (i.e. the Documents directory, which is in the WebServer directory, which is in the Library folder), and this is accessible from your web browser as http://www.mysys.com/, then you could enter /Library/WebServer/Documents/sawmill/ as the Temporary directory and http://www.mydomain.com/sawmill/ as the Temporary directory URL.

Example 2: For Windows, if the root of your web server is at C:\inetpub\wwwroot\ (i.e. the wwwroot directory, which is in the inetpub directory, which is on the C drive), and this is accessible from your web browser as http://www.mysys.com/, then you could enter C:\\inetpub\\wwwroot\\ sawmill\\ as the Temporary directory and http://www.mydomain.com/sawmill/ as the Temporary directory URL.

Example 3: For UNIX, if the root of your web server is at /home/httpd/html/, and this is accessible from your web browser as http://www.mydomain.com/, then you could enter /home/httpd/html/sawmill/ as the Temporary directory and http://www.mysys.com/sawmill/ as the Temporary directory URL.

It is also possible to use relative pathnames, which sometimes makes it easier; e.g. on UNIX if both the cgi-bin directory and the html directory are in the same directory, you can use ../html/sawmill as the temporary directory, without having to specify the full pathname.

See Web Server Information for more information.