Apache HTTP Server Version 2.4
Description: | Serve MVS (z/OS) Datasets |
---|---|
Status: | Extension |
Module Identifier: | mvsds_module |
Source File: | mod_mvsds.c |
This module provides support for serving MVS datasets, including indexes of partitioned datasets.
LoadModule mvsds_module modules/mod_mvsds.so <Location /mvsds> MVSDS ON MvsdsDefaultTextType text/plain </Location>
RewriteEngine ON RewriteRule ^/example.html /mvsds/'EXAMPLE.DSN' [PT,E=mvsds-handler:true]
A MVSDS dataset with a .Z extension will return garbage starting in IBM HTTP
Server 9.0 and above. The issue is that mod_charset_lite will no longer translate
responses with a Content-Encoding set unless it has a value of 7bit
,
8bit
, binary
, or identity
.
The Content-Encoding header is set for files containing a .Z
in the
filename because the default configuration includes the directive
AddEncoding x-compress Z
.
To remove the content encoding for MVSDS datasets, RemoveEncoding
can be added to the MVSDS location stanza:
<Location /mvsds> MVSDS ON MvsdsDefaultTextType text/plain RemoveEncoding Z </Location>
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
ForceType
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.
ForceType
can be used to set the content
type, but this will override any file extension mapping or other directives.
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. Note: After PH09519, the directive
MimeOptions
can be used to ignore the "inner" extensions.
<Location /mvsds> MVSDS ON AddType text/xml .MYEXT AddType text/html .INEXT </Location>
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>
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.
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.
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
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 9.0.0.3 |
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.
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.
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.
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 9.0.0.1 |
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.