Module and Handler Directives

Action

Description Specify the CGI program to run to handle the document
Synopsis
Action mimeType programPath
Context Default server, Virtual host
Example
Action application/x-appWeb-python /usr/bin/python
The Action directive associates the specified program path with a document mime type. The Action directive may be  used to ensure a specific program is used to run CGI scripts.

The CGI handler may match URLs by extension or by prefix path, depending on how the appWeb configuration file setup. When a match by extension occurs, the cgiHandler will first see if an Action directive has been specified for the corresponding mime type for the URLs extension. If one is defined, the specified program is run with the CGI script passed as the first argument. If no action directive is found, the script is examined to see if it contains a "#!/programPath" in the first line of the script. If it does, the specified program is run with the CGI script passed as the first argument. If the script is a binary executable or if the first line does not contain such a programPath, the CGI script will be directly executed.

The default  extensions in the appWeb configuration file are: cgi, cgi-nph, bat, cmd, pl, py, and php. For Linux, the default settings also include an Action directive for the php extension. The other default extensions do not have Action directives.

The mime type may be added via the AddType directive or you may edit the mime.types file to add the mime type. Mime type entries associate a mime type with a given URL extension. For example, the following mime entry specifies that any URL with a ".php" extension should will have the  application/x-appWeb-php mime type:

application/x-appWeb-php php

AddHandler

Description Add the specified handler for processing for given file extensions
Synopsis
AddHandler handlerName extension [extension] ...
Context Default server, Virtual host, Location
Example
AddHandler espHandler .esp .asp
The AddHandler directive ensures that the AppWeb handler specified by handlerName, will be run whenever a document with the given extension is requested. Multiple extensions may be specified and multiple AddHandler directives may exist for any handler.

If the AddHandler directive is specified within a VirtualHost or Location block, it is only valid within that context. VirtualHosts and Location blocks inherit the handler settings defined by outer blocks. I.e. a VirtualHost will inherit all the handlers of the default server. If you wish to remove a handler mapping, use ResetHandlers and then re-add the required handlers.

NOTE: Unlike Apache, the extensions are case sensitive on systems that have case sensitive file systems and the dot must be part of the extension.

AddType

Description Add a MIME type specifiction
Synopsis
AddType mimeType extension
Context Default server, Virtual host
Example
application/x-appWeb-perl pl
The AddType directive will associate the specified MIME type with the nominated extension. MIME types are used by AppWeb when processing CGI scripts. When processing client requests, AppWeb will map a URLs extension to a mime type. If an Action directive has been specified for this mime type, the associate program will be run using the CGI protocol to process the URL.

ResetHandlers

Description Reset the list of defined handlers.
Synopsis
ResetHandlers
Context Virtual host, Location
Example
ResetHandlers
The ResetHandlers directive cancels all previously defined handlers for the specified context. ResetHandlers is most often used inside VirtualHost blocks when you want to limit the handlers to a small set for that Virtual Host.

NOTE: ResetHandlers is a proprietary AppWeb directive and is not supported by Apache.

LoadModule

Description Load the static or dynamic AppWeb module
Synopsis LoadModule moduleName modulePath
Context Default server
Example
LoadModule openSsl /etc/appWeb/modules/libopenSsl.so
The LoadModule directive causes the specified module to be loaded and its functionality made available to the default server and all virtual hosts. AppWeb supports both static and dynamically loaded modules. Some essentail modules will be statically linked into AppWeb. Modules that may or may not be required by particular users will be supplied as dynamically loadable modules. By supporting dynamic loadable modules, the memory footprint of AppWeb is minimized yet AppWeb can be extended to meet almost any need.

Modules may be dynamically loaded shared objects (DLLs) or they may be statically linked objects. If a module is statically linked into AppWeb, the LoadModule directive will start the module and activate it for processing. If a module is not statically linked into AppWeb and it has been made into a dynamically loadable module, then the LoadModule directive will locate and dynamically load the shared object or DLL, link it into AppWeb and then activate it for processing.

The moduleName is encoded in the module itself and must be the name specified by the module provider. The modulePath is the filename for the module without the extension. AppWeb omits the extension so that configuration files will be more cross-platform. The modulePath may be an absolute path or it may be relative to the Server Root. If the modulePath if a pure filename without any directory portion, the directory paths specified by the LoadModulePath are used to search for the module.

The order of modules in the configuration file is important. If module "A" uses the services of module "B", then module "B" must be loaded prior to loading module "A".

Handlers and Modules

There are two kinds of loadable modules:
  • Handlers

  • Pure modules

Handlers are modules that respond to HTTP requests and serve the  response content themselves. Pure modules are units of functionality that augment AppWeb without directly handling HTTP responses themselves.

AppWeb supplied modules

Authorization Module
auth
libauthModule
Common Gateway Interface Handler cgi
libcgiHandler
C API Module
capi
libcapiModule
Debug Handler
debug
libdebugHandler
Embedded Gateway Interface Handler egi
libegiHandler
Embedded Server Pages Handler esp
libespHandler
GoAhead WebServer API Compatibility Module
compat
libcompatModule
Matrix SSL Module
matrixSsl
libmatrixSslModule
Open SSL Module
openSsl
libopenSslModule
Secure Sockets Layer Module
ssl
libsslModule
Static Page Handler
static
libcopyHandler

NOTE: AppWeb modules are not binary or source compatible with Apache modules.

 

LoadModulePath

Description Specify a list of directory paths to search when loading Modules
Synopsis LoadModule path ...
Context Default server
Example
LoadModulePath ../bin /home/josh/test

The LoadModulePath directive causes subsequent LoadModule directives to search for their modules in the paths nominate by the LoadModulePath directive, if those paths are do not contain directory paths.



 

© Mbedthis Software LLC, 2003-2204. All rights reserved. Mbedthis is a trademark of Mbedthis Software LLC.