Configuring Your Web Server to Recognize htmSQL Input Files

Overview of Configuring Your Web Server for htmSQL

When you configure your Web server to recognize htmSQL input files, you no longer have to specify the pathname of the htmSQL executable in the URL that you use for invoking htmSQL. For example, instead of the URL http://support.sas.com/cgi-bin/htmSQL/myinput/myfile.hsql, you can use http://support.sas.com/myinput/myfile.hsql and the Web server automatically invokes htmSQL to process the input file.
The following sections provide some instructions on how to configure various Web servers to recognize htmSQL input files.
Note: This section discusses only servers that we have tested. It is not an exhaustive discussion of the topic. If you encounter problems when configuring your Web server or for more information about configuring your Web server, consult your Web server documentation.

Apache

To configure the Apache Web server (version 1.1 or later), add the following lines to the srm.conf file. The lines that begin with the pound sign (#) are comment lines that are already in the srm.conf file that is included in the Apache download package.
# AddHandler allows you to map certain file extensions to "handlers",
# actions unrelated to filetype. These can be either built into the server
# or added with the Action command (see below)
# Format: AddHandler action-name ext1

AddHandler htmSQL .hsql

# Action lets you define media types that execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location

Action htmSQL /cgi-bin/htmSQL

Peer Web Services and the Internet Information Server

Internet Information Server (IIS) 7.0

To set up htmSQL on IIS 7.0, complete the following steps:
  1. Open the applicationHost.config file located in C:\Windows\System32\inetsrv\config\.
  2. Locate and then edit the following line so that the overrideModeDefault variable is set to Allow:
    <section name="handlers" overrideModeDefault="Allow" />
  3. Save the file.
  4. Open the web.config file. The default location for the file is in the same folder where the CGI executables are located. However, if there is no web.config file in this folder, then you need to create one.
  5. Make the following edit to the file:
    <configuration>
       <system.webServer>
          <handlers>
             <add name="ScriptMap1" path="broker.exe" verb="*" modules="CgiModule" 
                scriptProcessor="c:\inetpub\scripts\broker.exe" resourceType="File" 
                allowPathInfo="true" />
             <add name="ScriptMap2" path="htmSQL.exe" verb="*" modules="CgiModule" 
                scriptProcessor="c:\inetpub\scripts\htmSQL.exe" resourceType="File" 
                allowPathInfo="true" />
          </handlers>
       </system.webServer>
    </configuration>
  6. Save the file.
  7. Restart the IIS Web server.
See http://support.sas.com/techsup/technote/ts794.pdf for more information about configuring IIS 7.0 for SAS/IntrNet software.

Internet Information Server (IIS) 6.0

To set up htmSQL on IIS 6.0, complete the following steps within the IIS Administrator:
  1. In IIS, right-click the individual Web site or the Web Sites folder, and then click Properties.
  2. On the Home Directory tab, click Configuration.
  3. Under Application Configuration, click Add, and then click the Mappings tab.
  4. With the Add/Edit Application Extension Mapping dialog box open, click Browse to select the htmsql.exe file from the local path on the Web server.
    Note: You must type the path to a valid file in the Executable text box or the OK button remains unavailable. The easiest way to ensure that you enter a valid path is to select the file by using the Browse button.
  5. After the path appears in the Executable text box, click in the Executable text box to initialize the path.
  6. Click in the Extension space, and then enter .hsql as the filename extension.
    Note: You must enter the period (.) in front of the extension in the Extension text box, or the OK button remains unavailable.
  7. Click OK.
  8. Configure IIS to allow the hsql MIME type. This can be done by completing the following steps:
    1. In the left window of the IIS Administrator, right-click your machine name and select Properties.
    2. Add a MIME type of .hsql, application/octet-stream.
  9. Right-click the directory where the htmsql.exe file is located (for example, cgi-bin) and allow scripts and executables. If your IIS6 Web Server does not already have a scripts directory or a cgi-bin directory, you need to create one. After you create this directory, on the Virtual Directory tab, specify Scripts and Executables for the value of Execution Permissions.
    Some versions of IIS might have a check box called Execute (such as ISAPI applications or CGI). If you have this selection, then the box should be checked.
  10. Right-click the directory where the Web site is located (for example, MyWeb) and allow scripts and executables.
  11. Enable Web Service Extensions for the htmsql.exe file. This can be done by completing the following steps:
    1. In the left window of the IIS Administrator, select your machine name. Then select the Web Service Extensions folder. The Web Service Extensions folder is under the folder that specifies the name of your machine. For example, if your machine name is SUSAN2, then there should be three folders under SUSAN2 (called Application Pools, Web Sites, and Web Service Extensions).
    2. Browse to the EXE for htmSQL and click Allow (to permit the htmsql.exe file to execute). Otherwise, the status is DENY.
  12. Start your SAS/SHARE server.
For more information about running CGI tools on the Microsoft IIS 6.0 Web server, see SAS Note #23931 at support.sas.com/kb.

Internet Information Server (IIS) 5.0 and Earlier and Peer Web Services

To configure Microsoft Peer Web Services for Windows NT workstations or the Microsoft IIS for Windows NT servers, you must add two string values for the following key in the Windows registry on your Web server machine:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\ScriptMap]
Use the Registry Editor (regedit) to add the following string values:
".hsql"="c:\directory_for_htmSQL_executable\htmSQL.exe"
".hsq"="c:\directory_for_htmSQL_executable\htmSQL.exe"
Ensure that you change directory_for_htmSQL_executable to the directory in which you installed htmSQL.
Note: You must also turn on the execute bit for the directory that contains the .hsq or .hsql files.