2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
7 Licensed to the Apache Software Foundation (ASF) under one or more
8 contributor license agreements. See the NOTICE file distributed with
9 this work for additional information regarding copyright ownership.
10 The ASF licenses this file to You under the Apache License, Version 2.0
11 (the "License"); you may not use this file except in compliance with
12 the License. You may obtain a copy of the License at
14 http://www.apache.org/licenses/LICENSE-2.0
16 Unless required by applicable law or agreed to in writing, software
17 distributed under the License is distributed on an "AS IS" BASIS,
18 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License for the specific language governing permissions and
20 limitations under the License.
23 <modulesynopsis metafile="mod_isapi.xml.meta">
25 <name>mod_isapi</name>
26 <description>ISAPI Extensions within Apache for Windows</description>
28 <sourcefile>mod_isapi.c</sourcefile>
29 <identifier>isapi_module</identifier>
30 <compatibility>Win32 only</compatibility>
33 <p>This module implements the Internet Server extension API. It
34 allows Internet Server extensions (<em>e.g.</em> ISAPI .dll
35 modules) to be served by Apache for Windows, subject to the
36 noted restrictions.</p>
38 <p>ISAPI extension modules (.dll files) are written by third
39 parties. The Apache Group does not author these modules, so we
40 provide no support for them. Please contact the ISAPI's author
41 directly if you are experiencing problems running their ISAPI
42 extension. <strong>Please <em>do not</em> post such problems to
43 Apache's lists or bug reporting pages.</strong></p>
46 <section id="usage"><title>Usage</title>
48 <p>In the server configuration file, use
49 the <directive module="mod_mime">AddHandler</directive> directive to
50 associate ISAPI files with the <code>isapi-handler</code> handler, and map
51 it to them with their file extensions. To enable any .dll file to be
52 processed as an ISAPI extension, edit the httpd.conf file and add the
55 AddHandler isapi-handler.dll
58 <note>In older versions of the Apache server,
59 <code>isapi-isa</code> was the proper handler name, rather than
60 <code>isapi-handler</code>. As of 2.3 development versions of the Apache
61 server, <code>isapi-isa</code> is no longer valid. You will need to
62 change your configuration to use <code>isapi-handler</code>
65 <p>There is no capability within the Apache server to leave a
66 requested module loaded. However, you may preload and keep a
67 specific module loaded by using the following syntax in your
70 ISAPICacheFile c:/WebWork/Scripts/ISAPI/mytest.dll
73 <p>Whether or not you have preloaded an ISAPI extension, all
74 ISAPI extensions are governed by the same permissions and
75 restrictions as CGI scripts. That is, <directive module="core"
76 >Options</directive> <code>ExecCGI</code> must be set for the
77 directory that contains the ISAPI .dll file.</p>
79 <p>Review the <a href="#notes">Additional Notes</a> and the <a
80 href="#journal">Programmer's Journal</a> for additional details
81 and clarification of the specific ISAPI support offered by
82 <module>mod_isapi</module>.</p>
85 <section id="notes"><title>Additional Notes</title>
87 <p>Apache's ISAPI implementation conforms to all of the ISAPI
88 2.0 specification, except for some "Microsoft-specific"
89 extensions dealing with asynchronous I/O. Apache's I/O model
90 does not allow asynchronous reading and writing in a manner
91 that the ISAPI could access. If an ISA tries to access
92 unsupported features, including async I/O, a message is placed
93 in the error log to help with debugging. Since these messages
94 can become a flood, the directive <code>ISAPILogNotSupported
95 Off</code> exists to quiet this noise.</p>
97 <p>Some servers, like Microsoft IIS, load the ISAPI extension
98 into the server and keep it loaded until memory usage is too
99 high, or unless configuration options are specified. Apache
100 currently loads and unloads the ISAPI extension each time it is
101 requested, unless the <directive module="mod_isapi"
102 >ISAPICacheFile</directive> directive is specified.
103 This is inefficient, but Apache's memory model makes this the
104 most effective method. Many ISAPI modules are subtly
105 incompatible with the Apache server, and unloading these
106 modules helps to ensure the stability of the server.</p>
108 <p>Also, remember that while Apache supports ISAPI Extensions,
109 it <strong>does not support ISAPI Filters</strong>. Support for
110 filters may be added at a later date, but no support is planned
114 <section id="journal"><title>Programmer's Journal</title>
116 <p>If you are programming Apache 2.0 <module>mod_isapi</module>
117 modules, you must limit your calls to <code>ServerSupportFunction</code>
118 to the following directives:</p>
121 <dt><code>HSE_REQ_SEND_URL_REDIRECT_RESP</code></dt>
122 <dd>Redirect the user to another location.<br />
123 This must be a fully qualified URL (<em>e.g.</em>
124 <code>http://server/location</code>).</dd>
126 <dt><code>HSE_REQ_SEND_URL</code></dt>
127 <dd>Redirect the user to another location.<br />
128 This cannot be a fully qualified URL, you are not allowed to
129 pass the protocol or a server name (<em>e.g.</em> simply
130 <code>/location</code>).<br />
131 This redirection is handled by the server, not the
133 <note type="warning"><title>Warning</title>
134 <p>In their recent documentation, Microsoft appears to have
135 abandoned the distinction between the two
136 <code>HSE_REQ_SEND_URL</code> functions. Apache continues to treat
137 them as two distinct functions with different requirements
141 <dt><code>HSE_REQ_SEND_RESPONSE_HEADER</code></dt>
142 <dd>Apache accepts a response body following the header if it
143 follows the blank line (two consecutive newlines) in the
144 headers string argument. This body cannot contain NULLs,
145 since the headers argument is NULL terminated.</dd>
147 <dt><code>HSE_REQ_DONE_WITH_SESSION</code></dt>
148 <dd>Apache considers this a no-op, since the session will be
149 finished when the ISAPI returns from processing.</dd>
151 <dt><code>HSE_REQ_MAP_URL_TO_PATH</code></dt>
152 <dd>Apache will translate a virtual name to a physical
155 <dt><code>HSE_APPEND_LOG_PARAMETER</code></dt>
157 This logged message may be captured in any of the following
161 <li>in the <code>\"%{isapi-parameter}n\"</code> component in a
162 <directive module="mod_log_config">CustomLog</directive>
165 <li>in the <code>%q</code> log component with the
166 <directive module="mod_isapi">ISAPIAppendLogToQuery</directive>
167 <code>On</code> directive</li>
169 <li>in the error log with the <directive module="mod_isapi"
170 >ISAPIAppendLogToErrors</directive> <code>On</code> directive</li>
173 <p>The first option, the <code>%{isapi-parameter}n</code> component,
174 is always available and preferred.</p>
177 <dt><code>HSE_REQ_IS_KEEP_CONN</code></dt>
178 <dd>Will return the negotiated Keep-Alive status.</dd>
180 <dt><code>HSE_REQ_SEND_RESPONSE_HEADER_EX</code></dt>
181 <dd>Will behave as documented, although the <code>fKeepConn</code>
182 flag is ignored.</dd>
184 <dt><code>HSE_REQ_IS_CONNECTED</code></dt>
185 <dd>Will report false if the request has been aborted.</dd>
188 <p>Apache returns <code>FALSE</code> to any unsupported call to
189 <code>ServerSupportFunction</code>, and sets the
190 <code>GetLastError</code> value to
191 <code>ERROR_INVALID_PARAMETER</code>.</p>
193 <p><code>ReadClient</code> retrieves the request body exceeding the
194 initial buffer (defined by <directive module="mod_isapi"
195 >ISAPIReadAheadBuffer</directive>). Based on the
196 <directive>ISAPIReadAheadBuffer</directive> setting (number of bytes
197 to buffer prior to calling the ISAPI handler) shorter requests are sent
198 complete to the extension when it is invoked. If the request is
199 longer, the ISAPI extension must use <code>ReadClient</code> to
200 retrieve the remaining request body.</p>
202 <p><code>WriteClient</code> is supported, but only with the
203 <code>HSE_IO_SYNC</code> flag or no option flag (value of
204 <code>0</code>). Any other <code>WriteClient</code> request
205 will be rejected with a return value of <code>FALSE</code>, and a
206 <code>GetLastError</code> value of
207 <code>ERROR_INVALID_PARAMETER</code>.</p>
209 <p><code>GetServerVariable</code> is supported, although extended server
210 variables do not exist (as defined by other servers.) All the
211 usual Apache CGI environment variables are available from
212 <code>GetServerVariable</code>, as well as the <code>ALL_HTTP</code>
213 and <code>ALL_RAW</code> values.</p>
215 <p>Apache 2.0 <module>mod_isapi</module> supports additional
216 features introduced in later versions of the ISAPI specification,
217 as well as limited emulation of async I/O and the
218 <code>TransmitFile</code> semantics. Apache also supports preloading
219 ISAPI .dlls for performance, neither of which were not available under
220 Apache 1.3 <code>mod_isapi</code>.</p>
224 <name>ISAPICacheFile</name>
225 <description>ISAPI .dll files to be loaded at startup</description>
226 <syntax>ISAPICacheFile <var>file-path</var> [<var>file-path</var>]
228 <contextlist><context>server config</context><context>virtual host</context>
232 <p>Specifies a space-separated list of file names to be loaded
233 when the Apache server is launched, and remain loaded until the
234 server is shut down. This directive may be repeated for every
235 ISAPI .dll file desired. The full path name of each file should
236 be specified. If the path name is not absolute, it will be treated
237 relative to <directive module="core">ServerRoot</directive>.</p>
242 <name>ISAPIReadAheadBuffer</name>
243 <description>Size of the Read Ahead Buffer sent to ISAPI
244 extensions</description>
245 <syntax>ISAPIReadAheadBuffer <var>size</var></syntax>
246 <default>ISAPIReadAheadBuffer 49152</default>
247 <contextlist><context>server config</context><context>virtual host</context>
248 <context>directory</context><context>.htaccess</context></contextlist>
249 <override>FileInfo</override>
252 <p>Defines the maximum size of the Read Ahead Buffer sent to
253 ISAPI extensions when they are initially invoked. All remaining
254 data must be retrieved using the <code>ReadClient</code> callback; some
255 ISAPI extensions may not support the <code>ReadClient</code> function.
256 Refer questions to the ISAPI extension's author.</p>
261 <name>ISAPILogNotSupported</name>
262 <description>Log unsupported feature requests from ISAPI
263 extensions</description>
264 <syntax>ISAPILogNotSupported on|off</syntax>
265 <default>ISAPILogNotSupported off</default>
266 <contextlist><context>server config</context><context>virtual host</context>
267 <context>directory</context><context>.htaccess</context></contextlist>
268 <override>FileInfo</override>
271 <p>Logs all requests for unsupported features from ISAPI
272 extensions in the server error log. This may help administrators
273 to track down problems. Once set to on and all desired ISAPI modules
274 are functioning, it should be set back to off.</p>
279 <name>ISAPIAppendLogToErrors</name>
280 <description>Record <code>HSE_APPEND_LOG_PARAMETER</code> requests from
281 ISAPI extensions to the error log</description>
282 <syntax>ISAPIAppendLogToErrors on|off</syntax>
283 <default>ISAPIAppendLogToErrors off</default>
284 <contextlist><context>server config</context><context>virtual host</context>
285 <context>directory</context><context>.htaccess</context></contextlist>
286 <override>FileInfo</override>
289 <p>Record <code>HSE_APPEND_LOG_PARAMETER</code> requests from ISAPI
290 extensions to the server error log.</p>
295 <name>ISAPIAppendLogToQuery</name>
296 <description>Record <code>HSE_APPEND_LOG_PARAMETER</code> requests from
297 ISAPI extensions to the query field</description>
298 <syntax>ISAPIAppendLogToQuery on|off</syntax>
299 <default>ISAPIAppendLogToQuery on</default>
300 <contextlist><context>server config</context><context>virtual host</context>
301 <context>directory</context><context>.htaccess</context></contextlist>
302 <override>FileInfo</override>
305 <p>Record <code>HSE_APPEND_LOG_PARAMETER</code> requests from ISAPI
306 extensions to the query field (appended to the <directive
307 module="mod_log_config">CustomLog</directive> <code>%q</code>
313 <name>ISAPIFakeAsync</name>
314 <description>Fake asynchronous support for ISAPI callbacks</description>
315 <syntax>ISAPIFakeAsync on|off</syntax>
316 <default>ISAPIFakeAsync off</default>
317 <contextlist><context>server config</context><context>virtual host</context>
318 <context>directory</context><context>.htaccess</context></contextlist>
319 <override>FileInfo</override>
322 <p>While set to on, asynchronous support for ISAPI callbacks is