Module inclusion

From AOLserver Wiki
Revision as of 18:08, 16 April 2008 by Rcobb (talk | contribs) (New page: Typical AOLServer modules are written in either Tcl, C, or some combination of those languages (though, of course, new languages can be added via the C module interface). They are include...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Typical AOLServer modules are written in either Tcl, C, or some combination of those languages (though, of course, new languages can be added via the C module interface). They are included into your runtime using a section of the AOLServer Configuration file.

Configuring a binary or combined binary & Tcl module into your server

As documented somewhere else in the wiki, a binary module is a dynamically loadable library (.so or .dll) that will be linked into your server at startup. To get it linked in, you:

  1. Put the file in the right directory with an appropriate extension:
    • In the default configuration of AOLServer, the right place is usually {your installation directory}/bin (e.g., /usr/local/aolserver/lib). In the AOLServer configuration file, by convention, this directory name is written as "${bindir}". Some installations use a separate "${homedir}/lib" (thus ${libdir}) directory.
  2. Tell AOLServer it's there, and that you want to use it for your virtual server.
    • In the modules section associated with your virtual server (e.g., "ns/server/${servername}/modules" in nsd.tcl), add the library using the syntax:
      ns_param configurationSectionName locationOfDynamicLibrary
    For example:

ns_param nsopenssl "${bindir}/nsopenssl.so"

  1. Restart your server. You should see a line that looks like
[15/Apr/2008:15:39:35][31632.18446744071924766624][-main-] Notice: modload: loading '/usr/local/aolserver/bin/nsopenssl.so'