Sun Java System Web Server 6.1 SP12 Administrator's Guide

Installing Windows CGI Programs

This section discusses how to install Windows CGI Programs. The following topics are included in this section:

Overview of Windows CGI Programs

Windows CGI programs are handled much as other CGI programs. You specify a directory that contains only Windows CGI programs, or you specify that all Windows CGI programs have the same file extension. Like other CGI programs, you can use both methods at the same time if you want to. For example, you can create a directory for all your Windows CGI programs, and specify a Windows CGI file extension.

Although Windows CGI programs behave like regular CGI programs, your server processes the actual programs slightly differently. Therefore, you need to specify different directories for Windows CGI programs. If you enable the Windows CGI file type, it uses the file extension .wcg.

Sun Java System Web Servers support the Windows CGI 1.3a informal specification, with the following differences:

Specifying a Windows CGI Directory

To specify a Windows CGI-only directory, perform the following steps.

ProcedureTo specify windows CGI-only directory

  1. From the Class Manager, choose the Programs tab.

  2. Click the WinCGI Directory link.

    The WinCGI Directory window appears.

  3. In the URL Prefix text field, enter the URL prefix you want to use for this directory.

    The text you type appears as the directory for the Windows CGI programs in URLs. For example, if you type wcgi-programs as the URL prefix, all URLs to these Windows CGI programs have the following structure:

    http://yourserver.domain.com/wcgi-programs/program-name


    Note –

    The URL prefix you specify can be different from the real Windows CGI directory you specify in Specifying a Windows CGI Directory.


  4. Choose whether you want to enable script tracing.

    Click the Yes or No radio button under “Enable Script Tracing?”.

    CGI parameters are passed from the server to Windows CGI programs through files, which the server normally deletes after the Windows CGI program finishes execution. If you enable script tracing, these files are retained in a /temp directory or wherever the environment variables TMP and TEMP are pointing. Also, any window that the Windows CGI program brings up is shown when script tracing is enabled.

  5. In the WinCGI Directory field, enter the location of the directory as an absolute path.

    Note that this directory doesn’t have to be under your document root. This is the reason that you need to specify a URL prefix in Specifying a Windows CGI Directory.

  6. Click OK.

  7. Save and apply your changes.

    To remove an existing Windows CGI directory, click that directory’s Remove button in the Windows CGI Directory form. To change the URL prefix or Windows CGI directory of an existing directory, click that directory’s Edit button.

    Copy your Windows CGI programs into the directories you’ve specified. Remember that any file in those directories is processed as a Windows CGI file.

Specifying Windows CGI as a File Type

To specify a file extension for Windows CGI files, perform the following steps

ProcedureTo specify a file extension for windows CGI files

  1. From the Server Manager, choose the Server Preferences tab.

  2. Click the MIME Types link.

    The Global MIME Types window appears. For more information on the Global MIME Types, see Choosing MIME Types.

  3. Add a new MIME type with the following settings:

    • Type: type

    • Content type: magnus-internal/wincgi.

    • File Suffix: Enter the file suffixes that you want the server to associate with Windows CGI. If you activated CGI, WinCGI, and shell CGI file types, you must specify a different suffix for each type of CGI. For example, you can’t use the suffix .exe for both a CGI program and a shell CGI program. If you need to, you can edit the other MIME type fields on the page so that the suffixes are unique.

  4. Click the New Type button.

  5. Save and apply your changes.