Configuring Apache

The Apache configuration file for BIS is named mod_xbis.conf and is included in the Apache server configuration by an Include directive placed in the main httpd.conf configuration file. This shows the Include directive.

Include /opt/microfocus/VisualCOBOL/etc/mod_xbis.conf

If available, copy or link the mod_xbis.conf file to the /etc/httpd/conf.d directory. This circumvents the necessity of editing the main httpd.conf configuration file.

The BIS Configuration File

The BIS configuration file contains several sets of Apache configuration directives. The first set of directives configures Apache direct requests to the BIS Request Handler module. This sample shows this set of directives.

LoadFile                /opt/microfocus/VisualCOBOL/lib/libbisxml.so
LoadModule xbis_module  /opt/microfocus/VisualCOBOL/lib/mod_xbis22.so
AddHandler bis-stencil  srf
AddType    text/html    srf
AddType    text/x-component .htc

The LoadFile directive is required and should not be changed. It causes Apache to dynamically load the shared object containing the BIS Request Handler's XML parser when Apache starts.

The LoadModule directive is required and should not be changed. It causes Apache to dynamically load the shared object containing the BIS Request Handler when Apache starts.

The AddHandler directive causes all URIs that request files ending with srf to be processed by the BIS Request Handler. If it is desired to have the Request Handler process requests with other file extensions, add additional AddHandler directives.

The AddType directive causes the default content type of a response for a URI ending with srf to be text/html. An AddType directive should be added for each AddHandler directive added to serve an addition file extension.

The AddType directive for the .htc extension is necessary to cause Apache to serve HTML Components files (a Microsoft extension) with the correct content type.

These directives affect the amount and location of trace information produced by BIS.

BISTraceDirectory /var/xbis
BISTraceFile trace.log
BISKeepTraceFiles Off
BISTruncateTraceFile Off
BISTraceSuffix Page
BISMasterTrace On
BISMainDebug On
BISStencilDebug On
BISSEDebugLevel 0

The BISTraceDirectory directive specifies the directory where trace files are written. The default is /var/xbis. If this directive does not specify an absolute path, it is assumed to be relative to a default (/tmp on some systems).

The BISTraceFile directive indicates the name of the trace file. This directive should only be used when all tracing for all requests are written to the same file. If this directive does not specify an absolute path, it is relative to the directory specified by BISTraceDirectory.

The BISKeepTraceFiles directive controls whether trace files are kept after a session completes. The value of Off is the default, and it causes trace files to be deleted, unless a FILE option in a Trace tag (in a stencil file) requests that they be kept. The value of On causes trace files to be retained regardless of the presence of a FILE trace option.

The BISTruncateTraceFile directive controls whether trace files are truncated at the beginning of each request. The value of Off is the default and causes all requests of a session to be placed in the trace file. The value of On cause only the last request of the session to be placed in the trace file.

The BISTraceSuffix directive adds additional options to Trace tags (in a stencil file) whenever one is processed. The value of this directive is processed after the options specified in the Trace tag, but before the options specified in the trace query parameter. There is no default for this directive. The options are described in the Trace tag section. All Trace tag options are allowed.

The BISMasterTrace directive is a master switch that controls all tracing activity. The value of Off is the default and will prevent all tracing. This is the appropriate value for a production environment. The value of On allows tracing to occur.

The BISMainDebug directive controls tracing of tags as they are executed. The value of Off is the default and prevents trace messages. The value of On allows trace messages during execution of the stencil. This tracing approximates the tracing performed by BIS/IIS.

The BISStencilDebug directive controls tracing tags as they are parsed. The value of Off is the default and prevents trace messages. The value of On will cause trace messages diagnosing syntax errors in tags to be produced.

The BISSEDebugLevel directive controls tracing of the BIS Service Engine. The values are 0, 1, and 2. 0 is the normal level of tracing and is appropriate for seeing DISPLAY statements from the service program. 1 and 2 supply additional tracing and should only be used when directed by customer support.

BISRefreshDirectory /var/tmp/xbis.refresh

The BISRefreshDirectory directive names a directory where server responses are stored temporarily, in case the client user agents such as web browsers request a refresh (see the XMLExchange tag.) The indicated directory should have permissions which allow create, reading, write, and delete access by the Apache child process. If no directory is named, or if this directive is omitted, the BIS Request Handler will not attempt to provide correct responses to refresh requests which lead to unnecessary session sequence errors.

BISErrorMessage ErrorName Error Text

The BISErrorMessage directive overrides the text for one of the BIS Request Handler's error messages. One reason to do this is to provide error messages in a language other than English. The first operand of the directive is the name of the error to be overridden. The remainder of the directive is the new text to be displayed when ErrorName is encountered. The current set of the Request handler's error names and their text are present within mod_xbis.conf as commented out BISErrorMessage directives.

BISSesDaemonKey xxxxxxxx

The optional BISSesDaemonKey directive allows the shared memory key with which to contact the Service Engine to be specified. This directive should only be used when it is desired to run multiple Service Engine daemons on the same UNIX server. This is rare. The value is an 8-hex digit value that must match the SharedMemory option keyword of the configuration of the Service Engine to use.

Alias URL-Path Directory-Path

This standard Apache directive allows stencils (as well as other documents) to be served from directories outside of the Apache web server's document root. The URL-Path value is a string that is to be matched to the leading part of the path of desired URLs. When a match occurs, it is removed and replaced with the Directory-Path value to produce the actual file name of the requested document. When an Alias directive is used, create a corresponding Directory directive to specify additional configuration directives for the directory named Directory-Path.

<Directory Directory-Path>
    SetEnv BIS_ROOT_PATH /xbisvc22/samples
    SetEnv TEMP /var/xbis
    DirectoryIndex default.srf
</Directory>

This set of standard Apache directives demonstrates tailoring Apache directives to document directories. The Directory-Path value is the name of the directory to which the directives apply.

The SetEnv directives demonstrate setting server environment variables. The value of such a variable is available in a stencil in a Value tag. It is also available by enclosing its name between "%" characters. In the above example, %TEMP% in a stencil served from this directory would be replaced by /var/xbis.

The DirectoryIndex directive specifies the name of the default document to serve if only the directory name is specified in the requested URL.