Webmaster in a Nutshell

Previous Chapter 24 Next
 

24.2 Resource Configuration

The directives listed in this section are used to configure how the server handles resources requested by clients.

AddEncoding

AddEncoding suffix encoding_type

Allows you to specify which MIME encodings should be associated with documents from your server. Most commonly this is used to tell browsers when a document is compressed. For example, to tell browsers that documents ending in .gz are encoded in gzip format, you would include the following setting:

AddEncoding .gz x-gzip

Note that the encoding begins with x- which marks it as an unofficial encoding.

AddLanguage

AddLanguage suffix language_code

The AddLanguage directive allows you to specify which language should be associated with documents from your server. The format is the same as for AddEncoding:

AddLanguage .francais fr

This setting will associate the language French (ISO language code fr) with the extension .francais.

AddType

AddType suffix mime_type encoding_type quality

The AddType directive specifies how the server should associate MIME types with documents, based on their extensions. Where other servers only associate MIME type and subtype with an extension, the CERN server also allows an encoding and a quality, although both may be omitted. For example, suppose you want to tell the server how to handle several popular image types:

AddType .ppm image/ppm 7bit 0.3
AddType .gif image/gif binary 0.5
AddType .jpg image/jpeg binary 0.7
AddType .png image/png binary 0.9

These directives tell the server to make the appropriate type associations for PPM, GIF, JPEG, and PNG images, that PPM is a basic ASCII representation while the others are binary formats, and that when forced to choose it should prefer PNG to anything, JPEG to GIF or PPM, and GIF to PPM.

If the encoding is omitted, binary is assumed. If the quality is omitted, perfect quality is assumed and a score of 1.0 is used.

MaxContentL...

MaxContentLengthBuffer size

When the CERN server sends a response, it tries to include a Content-Length header. If a document is too long, the server must give up and simply transmit the document without length information. The MaxContentLengthBuffer directive specifies what length is "too long." The default setting is 50K.

MetaDir

MetaDir directory_name

The subdirectory of a requested document's directory containing extra headers to send in the server response. See MetaSuffix.

MetaSuffix

MetaSuffix suffix

Specifies the special extension used to identify an extra header information file. The server looks for a subdirectory in the requested document's directory of the same name specified with MetaDir directive. If that directory exists, it then looks for a file with the same name of the requested file, but with a suffix matching the name specified by MetaSuffix. The headers contained in this file are used in the server's response.

SuffixCaseSense

SuffixCaseSense On|Off

The SuffixCaseSense directive determines whether suffix matching is case-sensitive. This affects not only the MIME directives, but also the directory indexing directives. The default is for suffixes to be case-insensitive.

UserDir

UserDir directory_name

The path within each user's home directory for their Web directories.


Previous Home Next
Basic Server Configuration Book Index Translation Rules