Sambar Server Documentation

Server Modules


The Sambar Server default HTTP handlers can be over-ridden using the [modules] directive. This feature is similar to the Apache ScriptAlias functionality; it would typically be used to implement a proprietary server-side scripting language.

Each document URI is compared against the string-matching rules defined in the [modules] section of the config.ini file. If the URI matches the definition, the module handler is called in place of the default action. Because each URI is compared with each module definition rule, a large number of definitions will degrade server performance.

The sample module handler cgi_method is provided to execute CGI documents. The following illustrates how to install the CGI module handler for PERL scripts:

[modules]
*.pl = samples.dll:cgi_module

Any URI served out of the document directory that ends in .pl will be handled by the cgi_module handler. This functionality will allow you to specify a CGI as the Home or Default Page for your server. The following illustrates how to install the CGI module handler for both PERL and DOS batch scripts:

[modules]
*.bat *.pl = samples.dll:cgi_module

Lastly, the following sample illustrates how to install the WinCGI module handler for WinCGI executes:

[modules]
*.exe = samples.dll:wincgi_module

Note: Modules only apply to URIs requested from the Document directory, and cannot over-ride Sambar Scripting files (.stm).

© 1998 Sambar Technologies. All rights reserved. Terms of Use.