<-
Apache > HTTP Server > Documentation > Version 2.2 > Modules

Apache Module mod_mvsds

Description:Serve MVS (z/OS) Datasets
Status:Extension
Module Identifier:mvsds_module
Source File:mod_mvsds.c

Summary

This module provides support for serving MVS datasets, including indexes of partitioned datasets.

Directives

Topics

top

Example configuration

top

Content Type

If the MVS dataset being served is a member in a partitioned data set, and it has a valid file extension, the content-type related directives in mod_mime will be applied to it. Otherwise, the content type can be specified with DefaultType or MvsdsDefaultTextType inside of LocationMatch. The MvsdsDefaultTextType will be applied to any dataset that a content type has not been determined by the name and has been determined to be a text file. The DefaultType will be applied to any dataset that did not have a content type set based on the name or set from the MvsdsDefaultTextType directive. ForceType can be used to set the content type, but this will override any file extension mapping or other directives.

Example: Setting Content-Type via MIME Type Mapping

A MIME type mapping can be specified for datasets that end with a certain extension using AddType. For example, the dataset 'MYDATASET.EXAMPLE.MYEXT' can have a Content-Type of 'text/plain' set using the configuration

<Location /mvsds>
    MVSDS ON
    AddType text/plain .MYEXT
</Location>

Note that content type mappings are searched from right to left, and the first mapping that is matched is applied. The dataset 'MYDATASET.INEXT.MYEXT' with the configuration below will result in the Content-Type being set to 'text/html' for example.

<Location /mvsds>
    MVSDS ON
    AddType text/xml  .MYEXT
    AddType text/html .INEXT
</Location>

Example: Forcing a Content-Type

A Content-Type can be forced for a particular location by using the ForceType directive. The following configuraiton will force the dataset 'MYDATASET.EXAMPLE.MYEXT' have a Content-Type of 'text/plain'.

<LocationMatch /mvsds/'MYDATASET.EXAMPLE.MYEXT'>
    MVSDS ON
    ForceType text/plain
</LocationMatch>
top

Binary vs Text

When a Content-Type has been determined by any of the means in the preceding section, and it does not match text/* nor application/x-javascript, this module reads the underlying dataset in binary mode. Files read in binary mode are not translated by the operating system while being read. See the z/OS documentation for the open() system call for more details.

Otherwise, files are read in text mode and may undergo some transformation by the operating system. For example, newline characters may be added each time a record boundary is encountered.

When no Content-Type is determined, this module uses a heuristic to detect if a file should be opened as binary. The directive MvsdsNoBinarySniff can be used to force such a file to be treated as text.

The internal environment variable mvsds-force-fread-text can be set to force files to be read in text mode, regardless of Content-Type or MvsdsNoBinarySniff outcome.

top

Interaction with other modules

After PI80187 directives that map requests to the filesystem, such as Alias, will prevent this module from running when they overlap with "MVSDS ON". Prior to PI80187, the interaction was undefined/non-dterministic.

top

MVSDS Directive

Description:Enables serving MVS datasets for the enclosing location
Syntax:MVSDS ON|OFF
Default:OFF
Context:directory
Status:Extension
Module:mod_mvsds
Compatibility:Directive and functionality not available on z/OS until IBM HTTP Server 8.5.5.0

This directive configures the enclosing location to serve MVS datasets. Access would be of the form http://example.com/mvsds/'SYS1.PROCLIB(IEASYS00)' or http://example.com/mvsds/MYDS

top

MvsdsAlternateHtmlSniff Directive

Description:Specifies whether this module will use alternate rules when sniffing if a file is an HTML file or not.
Syntax:MvsdsAlternateHtmlSniff OFF|ON
Default:OFF
Context:directory
Status:Extension
Module:mod_mvsds
Compatibility:Directive and functionality not available on z/OS until IBM HTTP Server 8.5.5.12

There is an issue where any text files containing a string beginning with a '<' and ending with a '>' will be sent with a Content-Type of text/html. Enabling this directive causes stricter rules to be applied when sniffing for the HTML content-type. A file will be considered to be an HTML file if the first left angle bracket belongs to either the <html> tag, an HTML comment, or the HTML DOCTYPE declaration. Additionally, there must not be any alphanumeric characters preceding the first left angle bracket. The file's content type will otherwise be defined by MvsdsDefaultTextType which is 'text/plain' by default.

top

MvsdsDefaultTextType Directive

Description:Specify a default media type to assign to response content for which no other media type configuration could be found
Syntax:MvsdsDefaultTextType media-type|none
Default:OFF
Context:directory
Status:Extension
Module:mod_mvsds
Compatibility:Directive and functionality not available on z/OS until IBM HTTP Server 8.5.5.4

There will be times when the server is asked to provide a data set whose type cannot be determined by its MIME types mappings. The server SHOULD inform the client of the content-type of the document. If the server is unable to determine this by normal means, it will set it to the configured MvsdsDefaultTextType.

top

MVSDSIndexes Directive

Description:Configures generated directory indexes of partitioned data sets
Syntax:MVSDSIndexes ON|OFF
Default:OFF
Context:directory
Status:Extension
Module:mod_mvsds
Compatibility:Directive and functionality not available on z/OS until IBM HTTP Server 8.5.5.0

When a partitioned data set is accessed via this module, and this directive is enabled, the server will return a HTML response listing the PDS members, similar to the output of the z/OS Data Set List Utility.

top

MvsdsNoBinarySniff Directive

Description:Specifies whether this module will try to determine if a type-less file is binary
Syntax:MvsdsNoBinarySniff OFF|ON
Default:OFF
Context:directory
Status:Extension
Module:mod_mvsds
Compatibility:Directive and functionality not available on z/OS until IBM HTTP Server 8.5.5.10

When a file has no Content-Type specified, this module decides whether to read it as binary by looking at the beginning of the file. This directive can be used to disable the heuristic and always treat type-less files as text.