From: William A. Rowe Jr
Status: Base (Windows); Experimental (Unix)
+>Status: Base (Windows); Optional (Unix)
This is an experimental module. On selected operating systems it
-can be used to load modules into Apache at runtime via the Dynamic Shared Object (DSO) mechanism, rather
-than requiring a recompilation.
+ On selected operating systems this module can be used to load modules
+into Apache at runtime via the Dynamic Shared
+Object (DSO) mechanism, rather than requiring a recompilation.
On Unix, the loaded code typically comes from shared object files
-(usually with .so extension), whilst on Windows this
-module loads DLL files. This module is only available in
-Apache 1.3 and up.
-
+(usually with .so extension), on Windows this may either
+the .so or .dll extension. This module is
+only available in Apache 1.3 and up.
In previous releases, the functionality of this module was provided
for Unix by mod_dld, and for Windows by mod_dll. On Windows, mod_dll
was used in beta release 1.3b1 through 1.3b5. mod_so combines these
two modules into a single module for all operating systems.
+ Warning: Apache 1.3 modules cannot be directly used with
+ Apache 2.0 - the module must be modified to dynamically load or
+ compile into Apache 2.0. Note: the module name format changed for Windows with Apache
+ 1.3.15 and 2.0 - the modules are now named as mod_foo.so.
+ While mod_so still loads modules with ApacheModuleFoo.dll names, the
+ new naming convention is preferred; if you are converting your loadable
+ module for 2.0, please fix the name to this 2.0 convention. The Apache module API is unchanged between the Unix and Windows
versions. Many modules will run on Windows with no or little change
@@ -87,16 +95,16 @@ two modules into a single module for all operating systems.
To create a module DLL, a small change is necessary to the module's
source file: The module record must be exported from the DLL (which
- will be created later; see below). To do this, add the
- Replace the above with: Note that this will only be activated on Windows, so the module can
continue to be used, unchanged, with Unix if needed. Also, if you are
@@ -104,10 +112,13 @@ two modules into a single module for all operating systems.
record with that method instead. Now, create a DLL containing your module. You will need to link this
- against the ApacheCore.lib export library that is created when the
- ApacheCore.dll shared library is compiled. You may also have to change
+ against the libhttpd.lib export library that is created when the
+ libhttpd.dll shared library is compiled. You may also have to change
the compiler settings to ensure that the Apache header files are
- correctly located.
Summary
-Directives
-Creating DLL Modules for Windows
+Creating Loadable Modules for Windows
+
+MODULE_VAR_EXPORT
(defined in the Apache header files) to
- your module's module record definition. For example, if your module
+ will be created later; see below). To do this, add the AP_MODULE_DECLARE_DATA
(defined in the Apache header files)
+ to your module's module record definition. For example, if your module
has:
module foo_module;
- module MODULE_VAR_EXPORT foo_module;
+ module AP_MODULE_DECLARE_DATA foo_module;
This should create a DLL version of your module. Now simply place it
in the modules directory of your server root, and use
@@ -166,20 +177,13 @@ The LoadModule directive links in the object file or library
to the list of active modules. Module is the name of the
external variable of type module
in the file, and is
listed as the Module
-Identifier in the module documentation. Example (Unix):
+Identifier in the module documentation. Example:
LoadModule status_module modules/mod_status.so
-- -Example (Windows): -
-LoadModule status_module modules/ApacheModuleStatus.dll
-
-
-loads the named module from the modules subdirectory of the
-ServerRoot.+
loads the named module from the modules subdirectory of the + ServerRoot.