|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
|
|
Packit |
90a5c9 |
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
|
Packit |
90a5c9 |
This file is generated from xml source: DO NOT EDIT
|
|
Packit |
90a5c9 |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
|
Packit |
90a5c9 |
-->
|
|
Packit |
90a5c9 |
<title>mod_so - Apache HTTP Server Version 2.4</title>
|
|
Packit |
90a5c9 |
<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
|
|
Packit |
90a5c9 |
<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
|
|
Packit |
90a5c9 |
<link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" />
|
|
Packit |
90a5c9 |
<script src="../style/scripts/prettify.min.js" type="text/javascript">
|
|
Packit |
90a5c9 |
</script>
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
<link href="../images/favicon.ico" rel="shortcut icon" /></head>
|
|
Packit |
90a5c9 |
<body>
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Modules | Directives | FAQ | Glossary | Sitemap
|
|
Packit |
90a5c9 |
Apache HTTP Server Version 2.4
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Apache > HTTP Server > Documentation > Version 2.4 > Modules
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Apache Module mod_so
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Available Languages: en |
|
|
Packit |
90a5c9 |
fr |
|
|
Packit |
90a5c9 |
ja |
|
|
Packit |
90a5c9 |
ko |
|
|
Packit |
90a5c9 |
tr
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
modules into the server at start-up or restart time
|
|
Packit |
90a5c9 |
Status:Extension
|
|
Packit |
90a5c9 |
Module Identifier:so_module
|
|
Packit |
90a5c9 |
Source File:mod_so.c
|
|
Packit |
90a5c9 |
Compatibility:This is a Base module (always included) on
|
|
Packit |
90a5c9 |
Windows
|
|
Packit |
90a5c9 |
Summary
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
On selected operating systems this module can be used to
|
|
Packit |
90a5c9 |
load modules into Apache HTTP Server at runtime via the Dynamic Shared Object (DSO) mechanism,
|
|
Packit |
90a5c9 |
rather than requiring a recompilation.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
On Unix, the loaded code typically comes from shared object
|
|
Packit |
90a5c9 |
files (usually with .so extension), on Windows
|
|
Packit |
90a5c9 |
this may either be the .so or .dll
|
|
Packit |
90a5c9 |
extension.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Warning
|
|
Packit |
90a5c9 |
Modules built for one major version of the Apache HTTP Server
|
|
Packit |
90a5c9 |
will generally not work on another. (e.g. 1.3 vs. 2.0, or 2.0 vs.
|
|
Packit |
90a5c9 |
2.2) There are usually API changes between one major version and
|
|
Packit |
90a5c9 |
another that require that modules be modified to work with the new
|
|
Packit |
90a5c9 |
version.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Topics
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Creating Loadable Modules for Windows
|
|
Packit |
90a5c9 |
Directives
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
LoadFile
|
|
Packit |
90a5c9 |
LoadModule
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Bugfix checklistSee also
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Comments
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Note
|
|
Packit |
90a5c9 |
On Windows, where loadable files typically have a file extension
|
|
Packit |
90a5c9 |
of .dll , Apache httpd modules are called
|
|
Packit |
90a5c9 |
mod_whatever.so , just as they are on other platforms.
|
|
Packit |
90a5c9 |
However, you may encounter third-party modules, such as PHP for
|
|
Packit |
90a5c9 |
example, that continue to use the .dll convention.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
While mod_so still loads modules with
|
|
Packit |
90a5c9 |
ApacheModuleFoo.dll names, the new naming convention is
|
|
Packit |
90a5c9 |
preferred; if you are converting your loadable module for 2.0,
|
|
Packit |
90a5c9 |
please fix the name to this 2.0 convention.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
The Apache httpd module API is unchanged between the Unix and
|
|
Packit |
90a5c9 |
Windows versions. Many modules will run on Windows with no or
|
|
Packit |
90a5c9 |
little change from Unix, although others rely on aspects of the
|
|
Packit |
90a5c9 |
Unix architecture which are not present in Windows, and will
|
|
Packit |
90a5c9 |
not work.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
When a module does work, it can be added to the server in
|
|
Packit |
90a5c9 |
one of two ways. As with Unix, it can be compiled into the
|
|
Packit |
90a5c9 |
server. Because Apache httpd for Windows does not have the
|
|
Packit |
90a5c9 |
Configure program of Apache httpd for Unix, the module's
|
|
Packit |
90a5c9 |
source file must be added to the ApacheCore project file, and
|
|
Packit |
90a5c9 |
its symbols must be added to the
|
|
Packit |
90a5c9 |
os\win32\modules.c file.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
The second way is to compile the module as a DLL, a shared
|
|
Packit |
90a5c9 |
library that can be loaded into the server at runtime, using
|
|
Packit |
90a5c9 |
the LoadModule
|
|
Packit |
90a5c9 |
directive. These module DLLs can be distributed and run on any
|
|
Packit |
90a5c9 |
Apache httpd for Windows installation, without recompilation of the
|
|
Packit |
90a5c9 |
server.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
To create a module DLL, a small change is necessary to the
|
|
Packit |
90a5c9 |
module's source file: The module record must be exported from
|
|
Packit |
90a5c9 |
the DLL (which will be created later; see below). To do this,
|
|
Packit |
90a5c9 |
add the AP_MODULE_DECLARE_DATA (defined in the
|
|
Packit |
90a5c9 |
Apache httpd header files) to your module's module record definition.
|
|
Packit |
90a5c9 |
For example, if your module has:
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
module foo_module;
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Replace the above with:
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
module AP_MODULE_DECLARE_DATA foo_module;
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Note that this will only be activated on Windows, so the
|
|
Packit |
90a5c9 |
module can continue to be used, unchanged, with Unix if needed.
|
|
Packit |
90a5c9 |
Also, if you are familiar with .DEF files, you can
|
|
Packit |
90a5c9 |
export the module record with that method instead.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Now, create a DLL containing your module. You will need to
|
|
Packit |
90a5c9 |
link this against the libhttpd.lib export library that is
|
|
Packit |
90a5c9 |
created when the libhttpd.dll shared library is compiled. You
|
|
Packit |
90a5c9 |
may also have to change the compiler settings to ensure that
|
|
Packit |
90a5c9 |
the Apache httpd header files are correctly located. You can find
|
|
Packit |
90a5c9 |
this library in your server root's modules directory. It is
|
|
Packit |
90a5c9 |
best to grab an existing module .dsp file from the tree to
|
|
Packit |
90a5c9 |
assure the build environment is configured correctly, or
|
|
Packit |
90a5c9 |
alternately compare the compiler and link options to your
|
|
Packit |
90a5c9 |
.dsp.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
This should create a DLL version of your module. Now simply
|
|
Packit |
90a5c9 |
place it in the modules directory of your server
|
|
Packit |
90a5c9 |
root, and use the LoadModule
|
|
Packit |
90a5c9 |
directive to load it.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Description:Link in the named object file or library
|
|
Packit |
90a5c9 |
Syntax:LoadFile filename [filename] ...
|
|
Packit |
90a5c9 |
Context:server config, virtual host
|
|
Packit |
90a5c9 |
Status:Extension
|
|
Packit |
90a5c9 |
Module:mod_so
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
The LoadFile directive links in the named object files or
|
|
Packit |
90a5c9 |
libraries when the server is started or restarted; this is used
|
|
Packit |
90a5c9 |
to load additional code which may be required for some module
|
|
Packit |
90a5c9 |
to work. Filename is either an absolute path or
|
|
Packit |
90a5c9 |
relative to ServerRoot.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
For example:
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
LoadFile "libexec/libxmlparse.so"
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Description:Links in the object file or library, and adds to the list
|
|
Packit |
90a5c9 |
of active modules
|
|
Packit |
90a5c9 |
Syntax:LoadModule module filename
|
|
Packit |
90a5c9 |
Context:server config, virtual host
|
|
Packit |
90a5c9 |
Status:Extension
|
|
Packit |
90a5c9 |
Module:mod_so
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
The LoadModule directive links in the object file or library
|
|
Packit |
90a5c9 |
filename and adds the module structure named
|
|
Packit |
90a5c9 |
module to the list of active modules. Module
|
|
Packit |
90a5c9 |
is the name of the external variable of type
|
|
Packit |
90a5c9 |
module in the file, and is listed as the Module Identifier
|
|
Packit |
90a5c9 |
in the module documentation.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
For example:
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
LoadModule status_module "modules/mod_status.so"
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
loads the named module from the modules subdirectory of the
|
|
Packit |
90a5c9 |
ServerRoot.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Available Languages: en |
|
|
Packit |
90a5c9 |
fr |
|
|
Packit |
90a5c9 |
ja |
|
|
Packit |
90a5c9 |
ko |
|
|
Packit |
90a5c9 |
tr
|
|
Packit |
90a5c9 |
Notice:This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our mailing lists.
|
|
Packit |
90a5c9 |
<script type="text/javascript">
|
|
Packit |
90a5c9 |
var comments_shortname = 'httpd';
|
|
Packit |
90a5c9 |
var comments_identifier = 'http://httpd.apache.org/docs/2.4/mod/mod_so.html';
|
|
Packit |
90a5c9 |
(function(w, d) {
|
|
Packit |
90a5c9 |
if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
|
|
Packit |
90a5c9 |
d.write('
|
|
Packit |
90a5c9 |
var s = d.createElement('script');
|
|
Packit |
90a5c9 |
s.type = 'text/javascript';
|
|
Packit |
90a5c9 |
s.async = true;
|
|
Packit |
90a5c9 |
s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
|
|
Packit |
90a5c9 |
(d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
|
|
Packit |
90a5c9 |
}
|
|
Packit |
90a5c9 |
else {
|
|
Packit |
90a5c9 |
d.write('
|
|
Packit |
90a5c9 |
}
|
|
Packit |
90a5c9 |
})(window, document);
|
|
Packit |
90a5c9 |
//--></script>
|
|
Packit |
90a5c9 |
Copyright 2018 The Apache Software Foundation. Licensed under the Apache License, Version 2.0.
|
|
Packit |
90a5c9 |
Modules | Directives | FAQ | Glossary | Sitemap <script type="text/javascript">
|
|
Packit |
90a5c9 |
if (typeof(prettyPrint) !== 'undefined') {
|
|
Packit |
90a5c9 |
prettyPrint();
|
|
Packit |
90a5c9 |
}
|
|
Packit |
90a5c9 |
//--></script>
|
|
Packit |
90a5c9 |
</body></html>
|