mod_so.html revision 1b55e9e0a3c5fb40d9e46d3e6f711516a9a807fa
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL<html xmlns="http://www.w3.org/TR/xhtml1/strict"><head><!--
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTELXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL This file is generated from xml source: DO NOT EDIT
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTELXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL--><title>mod_so - Apache HTTP Server</title><link href="/style/manual.css" type="text/css" rel="stylesheet"/></head><body><blockquote><div align="center"><img alt="[APACHE DOCUMENTATION]" src="/images/sub.gif"/><h3>Apache HTTP Server Version 2.0</h3></div><h1 align="center">Apache Module mod_so</h1><table cellspacing="1" cellpadding="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td valign="top"><span class="help">Description:</span></td><td><description>
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTELThis module provides for loading of executable code and
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTELmodules into the server at start-up or restart time.</description></td></tr><tr><td><a href="module-dict.html#Status" class="help">Status:</a></td><td>Base (Windows>; Optional (Unix)</td></tr><tr><td><a href="module-dict.html#ModuleIdentifier" class="help">Module Identifier:</a></td><td>so_module</td></tr><tr><td align="left" valign="top"><a href="module-dict.html#Compatibility" class="help">Compatibility:</a></td><td><compatibility>Available in Apache 1.3 and later.</compatibility></td></tr></table></td></tr></table><h2>Summary</h2><summary>
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL <p>On selected operating systems this module can be used to
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL load modules into Apache at runtime via the <a href="/dso.html">Dynamic Shared Object</a> (DSO) mechanism,
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL rather than requiring a recompilation.</p>
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL <p>On Unix, the loaded code typically comes from shared object
3478c0295f07111f354c7eceb0adc561c48c98fcQuentin CASTEL files (usually with <samp>.so</samp> extension), on Windows
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL this may either the <samp>.so</samp> or <samp>.dll</samp>
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL extension. This module is only available in Apache 1.3 and
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL <p>In previous releases, the functionality of this module was
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL provided for Unix by mod_dld, and for Windows by mod_dll. On
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL Windows, mod_dll was used in beta release 1.3b1 through 1.3b5.
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL mod_so combines these two modules into a single module for all
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL operating systems.</p>
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL <p><strong>Warning: Apache 1.3 modules cannot be directly used
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL with Apache 2.0 - the module must be modified to dynamically
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL load or compile into Apache 2.0</strong>.</p>
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL</summary><h2>Directives</h2><ul><li><a href="#loadfile">LoadFile</a></li><li><a href="#loadmodule">LoadModule</a></li></ul><h2>Creating Loadable Modules
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTELfor Windows</h2>
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL <p><blockquote><table><tr><td bgcolor="#e0e5f5">Note: the module name format changed for Windows
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL with Apache 1.3.15 and 2.0 - the modules are now named as
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL mod_foo.so</td></tr></table></blockquote>. While mod_so still loads modules with
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL ApacheModuleFoo.dll names, the new naming convention is
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL preferred; if you are converting your loadable module for 2.0,
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL please fix the name to this 2.0 convention.</p>
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL <p>The Apache module API is unchanged between the Unix and
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL Windows versions. Many modules will run on Windows with no or
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL little change from Unix, although others rely on aspects of the
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL Unix architecture which are not present in Windows, and will
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL not work.</p>
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL <p>When a module does work, it can be added to the server in
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL one of two ways. As with Unix, it can be compiled into the
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL server. Because Apache for Windows does not have the
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL <code>Configure</code> program of Apache for Unix, the module's
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL source file must be added to the ApacheCore project file, and
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL its symbols must be added to the
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL <p>The second way is to compile the module as a DLL, a shared
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL library that can be loaded into the server at runtime, using
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL the <code><code class="directive">LoadModule</code></code>
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL directive. These module DLLs can be distributed and run on any
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL Apache for Windows installation, without recompilation of the
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL <p>To create a module DLL, a small change is necessary to the
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL module's source file: The module record must be exported from
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL the DLL (which will be created later; see below). To do this,
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL add the <code>AP_MODULE_DECLARE_DATA</code> (defined in the
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL Apache header files) to your module's module record definition.
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL For example, if your module has:</p>
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL module foo_module;
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL module AP_MODULE_DECLARE_DATA foo_module;
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL <p>Note that this will only be activated on Windows, so the
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL module can continue to be used, unchanged, with Unix if needed.
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL Also, if you are familiar with <code>.DEF</code> files, you can
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL export the module record with that method instead.</p>
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL <p>Now, create a DLL containing your module. You will need to
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL link this against the libhttpd.lib export library that is
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL created when the libhttpd.dll shared library is compiled. You
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL may also have to change the compiler settings to ensure that
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL the Apache header files are correctly located. You can find
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL this library in your server root's modules directory. It is
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL best to grab an existing module .dsp file from the tree to
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL assure the build environment is configured correctly, or
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL alternately compare the compiler and link options to your
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL <p>This should create a DLL version of your module. Now simply
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL place it in the <samp>modules</samp> directory of your server
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL root, and use the <code class="directive">LoadModule</code>
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL directive to load it.</p>
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL<hr/><h2><a name="LoadFile">LoadFile</a> <a name="loadfile">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Link in the named object file or library</td></tr><tr><td><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td><syntax>LoadFile <em>filename</em> [<em>filename</em>] ...</syntax></td></tr><tr><td><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>none</code></td></tr><tr><td><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config</td></tr><tr><td><a href="directive-dict.html#Status" class="help">Status:</a></td><td>Base (Windows>; Optional (Unix)</td></tr><tr><td><a href="directive-dict.html#Module" class="help">Module:</a></td><td>mod_so</td></tr></table></td></tr></table><usage>
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL <p>The LoadFile directive links in the named object files or
60e9e896a1a7a9e62db162e1e9fb6b3c2df50c33Quentin CASTEL libraries when the server is started or restarted; this is used
</usage><hr/><h2><a name="LoadModule">LoadModule</a> <a name="loadmodule">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Links in the object file or library, and adds to the list
of active modules</td></tr><tr><td><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td><syntax>LoadModule <em>module filename</em></syntax></td></tr><tr><td><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>none</code></td></tr><tr><td><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config</td></tr><tr><td><a href="directive-dict.html#Status" class="help">Status:</a></td><td>Base (Windows>; Optional (Unix)</td></tr><tr><td><a href="directive-dict.html#Module" class="help">Module:</a></td><td>mod_so</td></tr></table></td></tr></table><usage>
<code>module</code> in the file, and is listed as the <a href="module-dict.html#ModuleIdentifier">Module Identifier</a>