|
Apache HTTP Server Version 1.3Apache's Handler UseWhat is a HandlerA "handler" is an internal Apache representation of the action to be performed when a file is called. Generally, files have implicit handlers, based on the file type. Normally, all files are simply served by the server, but certain file typed are "handled" separately. For example, you may use a type of "application/x-httpd-cgi" to invoke CGI scripts. Apache 1.1 adds the additional ability to use handlers explicitly. Either based on filename extensions or on location, these handlers are unrelated to file type. This is advantageous both because it is a more elegant solution, but it also allows for both a type and a handler to be associated with a file. Handlers can either be built into the server or to a module, or they can be added with the Action directive. The built-in handlers in the standard distribution are as follows:
DirectivesAddHandlerSyntax: <AddHandler handler-name extension>Context: server config, virtual host, directory, .htaccess Status: Base Module: mod_mime AddHandler maps the filename extension extension to the
handler handler-name. For example, to activate CGI scripts
with the file extension " AddHandler cgi-script cgi Once that has been put into your srm.conf or httpd.conf file, any
file ending with " SetHandlerSyntax: <SetHandler handler-name>Context: directory, .htaccess Status: Base Module: mod_mime When placed into an SetHandler imap-file Another example: if you wanted to have the server display a status
report whenever a URL of <Location /status> SetHandler server-status </Location> Programmer's NoteIn order to implement the handler features, an addition has been
made to the Apache API that you may wish to
make use of. Specifically, a new record has been added to the
char *handler If you wish to have your module engage a handler, you need only to
set Apache HTTP Server Version 1.3 |
|||||||||||||||||
With any suggestions or questions please feel free to contact us |