]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_lua.xml
0c51337d8d5e8ca2932de617811052bd107701d2
[apache] / docs / manual / mod / mod_lua.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
5
6 <!--
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
13
14      http://www.apache.org/licenses/LICENSE-2.0
15
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.
21 -->
22
23 <modulesynopsis metafile="mod_lua.xml.meta">
24
25 <name>mod_lua</name>
26
27 <description>Provides Lua hooks into various portions of the httpd
28 request processing</description>
29 <status>Experimental</status>
30 <sourcefile>mod_lua.c</sourcefile>
31 <identifier>lua_module</identifier>
32 <compatibility>2.3 and later</compatibility>
33
34 <summary>
35 <p>This module allows the server to be extended with scripts written in the
36 Lua programming language.  The extension points (hooks) available with
37 <module>mod_lua</module> include many of the hooks available to
38 natively compiled Apache HTTP Server modules, such as mapping requests to
39 files, generating dynamic responses, access control, authentication, and
40 authorization</p>
41
42 <p>More information on the Lua programming language can be found at the
43 <a href="http://www.lua.org/">the Lua website</a>.</p>
44
45 <note><code>mod_lua</code> is still in experimental state.
46 Until it is declared stable, usage and behavior may change
47 at any time, even between stable releases of the 2.4.x series.
48 Be sure to check the CHANGES file before upgrading.</note>
49
50 </summary>
51
52 <section id="basicconf"><title>Basic Configuration</title>
53
54 <p>The basic module loading directive is</p>
55
56 <example>
57     LoadModule lua_module modules/mod_lua.so
58 </example>
59
60 <p>
61 <code>mod_lua</code> provides a handler named <code>lua-script</code>,
62 which can be used with an <code>AddHandler</code> directive:</p>
63
64 <example>
65 AddHandler lua-script .lua
66 </example>
67
68 <p>
69 This will cause <code>mod_lua</code> to handle requests for files
70 ending in <code>.lua</code> by invoking that file's
71 <code>handle</code> function.
72 </p>
73
74 <p>For more flexibility, see <directive>LuaMapHandler</directive>.
75 </p>
76
77 </section>
78
79 <section id="writinghandlers"><title>Writing Handlers</title>
80 <p> In the Apache HTTP Server API, the handler is a specific kind of hook
81 responsible for generating the response.  Examples of modules that include a
82 handler are <module>mod_proxy</module>, <module>mod_cgi</module>,
83 and <module>mod_status</module>.</p>
84
85 <p><code>mod_lua</code> always looks to invoke a Lua function for the handler, rather than
86 just evaluating a script body CGI style. A handler function looks
87 something like this:</p>
88
89 <example><title>example.lua</title><pre>
90 -- example handler
91
92 require "string"
93
94 --[[
95      This is the default method name for Lua handlers, see the optional
96      function-name in the LuaMapHandler directive to choose a different
97      entry point.
98 --]]
99 function handle(r)
100     r.content_type = "text/plain"
101     r:puts("Hello Lua World!\n")
102
103     if r.method == 'GET' then
104         for k, v in pairs( r:parseargs() ) do
105             r:puts( string.format("%s: %s", k, v) )
106         end
107     elseif r.method == 'POST' then
108         for k, v in pairs( r:parsebody() ) do
109             r:puts( string.format("%s: %s", k, v) )
110         end
111     else
112         r:puts("unknown HTTP method " .. r.method)
113     end
114 end
115 </pre></example>
116
117 <p>
118 This handler function just prints out the uri or form encoded
119 arguments to a plaintext page.
120 </p>
121
122 <p>
123 This means (and in fact encourages) that you can have multiple
124 handlers (or hooks, or filters) in the same script.
125 </p>
126
127 </section>
128
129 <section id="writinghooks"><title>Writing Hooks</title>
130
131 <p>Hook functions are how modules (and Lua scripts) participate in the
132 processing of requests. Each type of hook exposed by the server exists for
133 a specific purposes such as mapping requests to the filesystem,
134 performing access control, or setting mimetypes.  General purpose hooks
135 that simply run at handy times in the request lifecycle exist as well.</p>
136
137 <p>Hook functions are passed the request object as their only argument.
138 They can return any value, depending on the hook, but most commonly
139 they'll return OK, DONE, or DECLINED, which you can write in lua as
140 <code>apache2.OK</code>, <code>apache2.DONE</code>, or
141 <code>apache2.DECLINED</code>, or else an HTTP status code.</p>
142
143 <example><title>translate_name.lua</title><pre>
144 -- example hook that rewrites the URI to a filesystem path.
145
146 require 'apache2'
147
148 function translate_name(r)
149     if r.uri == "/translate-name" then
150         r.filename = r.document_root .. "/find_me.txt"
151         return apache2.OK
152     end
153     -- we don't care about this URL, give another module a chance
154     return apache2.DECLINED
155 end
156 </pre></example>
157
158 <example><title>translate_name2.lua</title><pre>
159 --[[ example hook that rewrites one URI to another URI. It returns a
160      apache2.DECLINED to give other URL mappers a chance to work on the
161      substitution, including the core translate_name hook which maps based
162      on the DocumentRoot.
163
164      Note: It is currently undefined as to whether this runs before or after
165      mod_alias.
166 --]]
167
168 require 'apache2'
169
170 function translate_name(r)
171     if r.uri == "/translate-name" then
172         r.uri = "/find_me.txt"
173         return apache2.DECLINED
174     end
175     return apache2.DECLINED
176 end
177 </pre></example>
178 </section>
179
180 <section id="datastructures"><title>Data Structures</title>
181
182 <dl>
183 <dt>request_rec</dt>
184         <dd>
185         <p>The request_rec is mapped in as a userdata. It has a metatable
186         which lets you do useful things with it. For the most part it
187         has the same fields as the request_rec struct (see httpd.h
188         until we get better docs here) many of which are writeable as
189         well as readable.  (The table fields' content can be changed, but the
190         fields themselves cannot be set to different tables.)</p>
191
192         <table border="1">
193
194         <tr>
195           <th><strong>Name</strong></th>
196           <th><strong>Lua type</strong></th>
197           <th><strong>Writable</strong></th>
198         </tr>
199         <tr>
200           <td><code>ap_auth_type</code></td>
201           <td>string</td>
202           <td>no</td>
203         </tr>
204         <tr>
205           <td><code>args</code></td>
206           <td>string</td>
207           <td>yes</td>
208         </tr>
209         <tr>
210           <td><code>assbackwards</code></td>
211           <td>boolean</td>
212           <td>no</td>
213         </tr>
214
215         <tr>
216           <td><code>canonical_filename</code></td>
217           <td>string</td>
218           <td>no</td>
219         </tr>
220         <tr>
221           <td><code>content_encoding</code></td>
222           <td>string</td>
223           <td>no</td>
224         </tr>
225         <tr>
226           <td><code>content_type</code></td>
227           <td>string</td>
228           <td>yes</td>
229         </tr>
230
231         <tr>
232           <td><code>document_root</code></td>
233           <td>string</td>
234           <td>no</td>
235         </tr>
236         <tr>
237           <td><code>err_headers_out</code></td>
238           <td>table</td>
239           <td>no</td>
240         </tr>
241         <tr>
242           <td><code>filename</code></td>
243           <td>string</td>
244           <td>yes</td>
245         </tr>
246         <tr>
247           <td><code>handler</code></td>
248           <td>string</td>
249           <td>yes</td>
250         </tr>
251
252         <tr>
253           <td><code>headers_in</code></td>
254           <td>table</td>
255           <td>yes</td>
256         </tr>
257         <tr>
258           <td><code>headers_out</code></td>
259           <td>table</td>
260           <td>yes</td>
261         </tr>
262         <tr>
263           <td><code>hostname</code></td>
264           <td>string</td>
265           <td>no</td>
266         </tr>
267         <tr>
268           <td><code>method</code></td>
269           <td>string</td>
270           <td>no</td>
271         </tr>
272         <tr>
273           <td><code>notes</code></td>
274           <td>table</td>
275           <td>yes</td>
276         </tr>
277         <tr>
278           <td><code>path_info</code></td>
279           <td>string</td>
280           <td>no</td>
281         </tr>
282         <tr>
283           <td><code>protocol</code></td>
284           <td>string</td>
285           <td>no</td>
286         </tr>
287         <tr>
288           <td><code>proxyreq</code></td>
289           <td>string</td>
290           <td>yes</td>
291         </tr>
292         <tr>
293           <td><code>range</code></td>
294           <td>string</td>
295           <td>no</td>
296         </tr>
297         <tr>
298           <td><code>subprocess_env</code></td>
299           <td>table</td>
300           <td>yes</td>
301         </tr>
302         <tr>
303           <td><code>status</code></td>
304           <td>number</td>
305           <td>yes</td>
306         </tr>
307         <tr>
308           <td><code>the_request</code></td>
309           <td>string</td>
310           <td>no</td>
311         </tr>
312         <tr>
313           <td><code>unparsed_uri</code></td>
314           <td>string</td>
315           <td>no</td>
316         </tr>
317         <tr>
318           <td><code>uri</code></td>
319           <td>string</td>
320           <td>yes</td>
321         </tr>
322         <tr>
323           <td><code>user</code></td>
324           <td>string</td>
325           <td>yes</td>
326         </tr>
327         </table>
328
329         <p>The request_rec has (at least) the following methods:</p>
330
331         <example>
332         r:addoutputfilter(name|function) -- add an output filter
333         </example>
334
335         <example>
336         r:parseargs() -- returns a lua table containing the request's
337                          query string arguments
338         </example>
339
340         <example>
341         r:parsebody() -- parse the request body as a POST and return
342                          a lua table
343         </example>
344
345         <example>
346         r:puts("hello", " world", "!") -- print to response body
347         </example>
348
349         <example>
350         r:write("a single string") -- print to response body
351         </example>
352         </dd>
353     </dl>
354
355 </section>
356
357 <section id="logging"><title>Logging Functions</title>
358
359 <example>
360         -- examples of logging messages<br />
361         r:trace1("This is a trace log message") -- trace1 through trace8 can be used <br />
362         r:debug("This is a debug log message")<br />
363         r:info("This is an info log message")<br />
364         r:notice("This is an notice log message")<br />
365         r:warn("This is an warn log message")<br />
366         r:err("This is an err log message")<br />
367         r:alert("This is an alert log message")<br />
368         r:crit("This is an crit log message")<br />
369         r:emerg("This is an emerg log message")<br />
370 </example>
371
372 </section>
373
374 <section id="apache2"><title>apache2 Package</title>
375 <p>A package named <code>apache2</code> is available with (at least) the following contents.</p>
376 <dl>
377   <dt>apache2.OK</dt>
378   <dd>internal constant OK.  Handlers should return this if they've
379   handled the request.</dd>
380   <dt>apache2.DECLINED</dt>
381   <dd>internal constant DECLINED.  Handlers should return this if
382   they are not going to handle the request.</dd>
383   <dt>apache2.DONE</dt>
384   <dd>internal constant DONE.</dd>
385   <dt>apache2.version</dt>
386   <dd>Apache HTTP server version string</dd>
387   <dt>apache2.HTTP_MOVED_TEMPORARILY</dt>
388   <dd>HTTP status code</dd>
389   <dt>apache2.PROXYREQ_NONE, apache2.PROXYREQ_PROXY, apache2.PROXYREQ_REVERSE, apache2.PROXYREQ_RESPONSE</dt>
390   <dd>internal constants used by <module>mod_proxy</module></dd>
391 </dl>
392 <p>(Other HTTP status codes are not yet implemented.)</p>
393 </section>
394
395 <directivesynopsis>
396 <name>LuaRoot</name>
397 <description>Specify the base path for resolving relative paths for mod_lua directives</description>
398 <syntax>LuaRoot /path/to/a/directory</syntax>
399 <contextlist><context>server config</context><context>virtual host</context>
400 <context>directory</context><context>.htaccess</context>
401 </contextlist>
402 <override>All</override>
403
404 <usage>
405     <p>Specify the base path which will be used to evaluate all
406     relative paths within mod_lua. If not specified they
407     will be resolved relative to the current working directory,
408     which may not always work well for a server.</p>
409 </usage>
410 </directivesynopsis>
411
412 <directivesynopsis>
413 <name>LuaScope</name>
414 <description>One of once, request, conn, server -- default is once</description>
415 <syntax>LuaScope once|request|conn|server [max|min max]</syntax>
416 <default>LuaScope once</default>
417 <contextlist><context>server config</context><context>virtual host</context>
418 <context>directory</context><context>.htaccess</context>
419 </contextlist>
420 <override>All</override>
421
422 <usage>
423     <p>Specify the lifecycle scope of the Lua interpreter which will
424     be used by handlers in this "Directory." The default is "once"</p>
425
426    <dl>
427     <dt>once:</dt> <dd>use the interpreter once and throw it away.</dd>
428
429     <dt>request:</dt> <dd>use the interpreter to handle anything based on
430              the same file within this request, which is also
431              request scoped.</dd>
432
433     <dt>conn:</dt> <dd>Same as request but attached to the connection_rec</dd>
434
435     <dt>server:</dt>  <dd>This one is different than others because the
436             server scope is quite long lived, and multiple threads
437             will have the same server_rec. To accommodate this
438             server scoped interpreter are stored in an apr
439             resource list. The min and max arguments are intended
440             to specify the pool size, but are unused at this time.</dd>
441    </dl>
442 </usage>
443 </directivesynopsis>
444
445 <directivesynopsis>
446 <name>LuaMapHandler</name>
447 <description>Map a path to a lua handler</description>
448 <syntax>LuaMapHandler uri-pattern /path/to/lua/script.lua [function-name]</syntax>
449 <contextlist><context>server config</context><context>virtual host</context>
450 <context>directory</context><context>.htaccess</context>
451 </contextlist>
452 <override>All</override>
453 <usage>
454     <p>This directive matches a uri pattern to invoke a specific
455     handler function in a specific file. It uses PCRE regular
456     expressions to match the uri, and supports interpolating
457     match groups into both the file path and the function name
458     be careful writing your regular expressions to avoid security
459     issues.</p>
460    <example><title>Examples:</title>
461     LuaMapHandler /(\w+)/(/w+) /scripts/$1.lua handle_$2
462    </example>
463         <p>This would match uri's such as /photos/show?id=9
464         to the file /scripts/photos.lua and invoke the
465         handler function handle_show on the lua vm after
466         loading that file.</p>
467
468 <example>
469     LuaMapHandler /bingo /scripts/wombat.lua
470 </example>
471         <p>This would invoke the "handle" function, which
472         is the default if no specific function name is
473         provided.</p>
474 </usage>
475 </directivesynopsis>
476
477 <directivesynopsis>
478 <name>LuaPackagePath</name>
479 <description>Add a directory to lua's package.path</description>
480 <syntax>LuaPackagePath /path/to/include/?.lua</syntax>
481 <contextlist><context>server config</context><context>virtual host</context>
482 <context>directory</context><context>.htaccess</context>
483 </contextlist>
484 <override>All</override>
485     <usage><p>Add a path to lua's module search path. Follows the same
486     conventions as lua. This just munges the package.path in the
487     lua vms.</p>
488
489     <example><title>Examples:</title>
490         LuaPackagePath /scripts/lib/?.lua<br />
491         LuaPackagePath /scripts/lib/?/init.lua
492     </example>
493 </usage>
494 </directivesynopsis>
495
496 <directivesynopsis>
497 <name>LuaPackageCPath</name>
498 <description>Add a directory to lua's package.cpath</description>
499 <syntax>LuaPackageCPath /path/to/include/?.soa</syntax>
500 <contextlist><context>server config</context><context>virtual host</context>
501 <context>directory</context><context>.htaccess</context>
502 </contextlist>
503 <override>All</override>
504
505 <usage>
506     <p>Add a path to lua's shared library search path. Follows the same
507     conventions as lua. This just munges the package.cpath in the
508     lua vms.</p>
509
510 </usage>
511 </directivesynopsis>
512
513 <directivesynopsis>
514 <name>LuaCodeCache</name>
515 <description>Configure the compiled code cache.</description>
516 <syntax>LuaCodeCache stat|forever|never</syntax>
517 <default>LuaCodeCache stat</default>
518 <contextlist><context>server config</context><context>virtual host</context>
519 <context>directory</context><context>.htaccess</context>
520 </contextlist>
521 <override>All</override>
522
523 <usage><p>
524     Specify the behavior of the in-memory code cache. The default
525     is stat, which stats the top level script (not any included
526     ones) each time that file is needed, and reloads it if the
527     modified time indicates it is newer than the one it has
528     already loaded. The other values cause it to keep the file
529     cached forever (don't stat and replace) or to never cache the
530     file.</p>
531
532     <p>In general stat or forever is good for production, and stat or never
533     for development.</p>
534
535     <example><title>Examples:</title>
536         LuaCodeCache stat<br />
537         LuaCodeCache forever<br />
538         LuaCodeCache never<br />
539     </example>
540
541 </usage>
542 </directivesynopsis>
543
544 <directivesynopsis>
545 <name>LuaHookTranslateName</name>
546 <description>Provide a hook for the translate name phase of request processing</description>
547 <syntax>LuaHookTranslateName  /path/to/lua/script.lua  hook_function_name [early|late]</syntax>
548 <contextlist><context>server config</context><context>virtual host</context>
549 <context>directory</context>
550 </contextlist>
551 <override>All</override>
552 <compatibility>The optional third argument is supported in 2.3.15 and later</compatibility>
553
554 <usage><p>
555     Add a hook (at APR_HOOK_MIDDLE) to the translate name phase of
556     request processing. The hook function receives a single
557     argument, the request_rec, and should return a status code,
558     which is either an HTTP error code, or the constants defined
559     in the apache2 module: apache2.OK, apache2.DECLINED, or
560     apache2.DONE. </p>
561
562     <p>For those new to hooks, basically each hook will be invoked
563     until one of them returns apache2.OK. If your hook doesn't
564     want to do the translation it should just return
565     apache2.DECLINED. If the request should stop processing, then
566     return apache2.DONE.</p>
567
568     <p>Example:</p>
569
570 <example><pre>
571 # httpd.conf
572 LuaHookTranslateName /scripts/conf/hooks.lua silly_mapper
573
574 -- /scripts/conf/hooks.lua --
575 require "apache2"
576 function silly_mapper(r)
577     if r.uri == "/" then
578         r.filename = "/var/www/home.lua"
579         return apache2.OK
580     else
581         return apache2.DECLINED
582     end
583 end
584 </pre></example>
585
586    <note><title>Context</title><p>This directive is not valid in <directive
587    type="section" module="core">Directory</directive>, <directive
588    type="section" module="core">Files</directive>, or htaccess
589    context.</p></note>
590
591    <note><title>Ordering</title><p>The optional arguments "early" or "late" 
592    control when this script runs relative to other modules.</p></note>
593
594 </usage>
595 </directivesynopsis>
596
597 <directivesynopsis>
598 <name>LuaHookFixups</name>
599 <description>Provide a hook for the fixups phase of request
600 processing</description>
601 <syntax>LuaHookFixups  /path/to/lua/script.lua hook_function_name</syntax>
602 <contextlist><context>server config</context><context>virtual host</context>
603 <context>directory</context><context>.htaccess</context>
604 </contextlist>
605 <override>All</override>
606 <usage>
607 <p>
608     Just like LuaHookTranslateName, but executed at the fixups phase
609 </p>
610 </usage>
611 </directivesynopsis>
612
613 <directivesynopsis>
614 <name>LuaHookMapToStorage</name>
615 <description>Provide a hook for the map_to_storage phase of request processing</description>
616 <syntax>LuaHookMapToStorage  /path/to/lua/script.lua hook_function_name</syntax>
617 <contextlist><context>server config</context><context>virtual host</context>
618 <context>directory</context><context>.htaccess</context>
619 </contextlist>
620 <override>All</override>
621     <usage><p>...</p></usage>
622 </directivesynopsis>
623
624 <directivesynopsis>
625 <name>LuaHookCheckUserID</name>
626 <description>Provide a hook for the check_user_id phase of request processing</description>
627 <syntax>LuaHookCheckUserID  /path/to/lua/script.lua hook_function_name [early|late]</syntax>
628 <contextlist><context>server config</context><context>virtual host</context>
629 <context>directory</context><context>.htaccess</context>
630 </contextlist>
631 <override>All</override>
632 <compatibility>The optional third argument is supported in 2.3.15 and later</compatibility>
633 <usage><p>...</p>
634    <note><title>Ordering</title><p>The optional arguments "early" or "late" 
635    control when this script runs relative to other modules.</p></note>
636 </usage>
637 </directivesynopsis>
638
639 <directivesynopsis>
640 <name>LuaHookTypeChecker</name>
641 <description>Provide a hook for the type_checker phase of request processing</description>
642 <syntax>LuaHookTypeChecker  /path/to/lua/script.lua hook_function_name</syntax>
643 <contextlist><context>server config</context><context>virtual host</context>
644 <context>directory</context><context>.htaccess</context>
645 </contextlist>
646 <override>All</override>
647     <usage><p>...</p></usage>
648 </directivesynopsis>
649
650 <directivesynopsis>
651 <name>LuaHookAuthChecker</name>
652 <description>Provide a hook for the auth_checker phase of request processing</description>
653 <syntax>LuaHookAuthChecker  /path/to/lua/script.lua hook_function_name [early|late]</syntax>
654 <contextlist><context>server config</context><context>virtual host</context>
655 <context>directory</context><context>.htaccess</context>
656 </contextlist>
657 <override>All</override>
658 <compatibility>The optional third argument is supported in 2.3.15 and later</compatibility>
659 <usage>
660 <p>Invoke a lua function in the auth_checker phase of processing
661 a request.  This can be used to implement arbitrary authentication
662 and authorization checking.  A very simple example:
663 </p>
664 <example><pre>
665 require 'apache2'
666
667 -- fake authcheck hook
668 -- If request has no auth info, set the response header and
669 -- return a 401 to ask the browser for basic auth info.
670 -- If request has auth info, don't actually look at it, just
671 -- pretend we got userid 'foo' and validated it.
672 -- Then check if the userid is 'foo' and accept the request.
673 function authcheck_hook(r)
674
675    -- look for auth info
676    auth = r.headers_in['Authorization']
677    if auth ~= nil then
678      -- fake the user
679      r.user = 'foo'
680    end
681
682    if r.user == nil then
683       r:debug("authcheck: user is nil, returning 401")
684       r.err_headers_out['WWW-Authenticate'] = 'Basic realm="WallyWorld"'
685       return 401
686    elseif r.user == "foo" then
687       r:debug('user foo: OK')
688    else
689       r:debug("authcheck: user='" .. r.user .. "'")
690       r.err_headers_out['WWW-Authenticate'] = 'Basic realm="WallyWorld"'
691       return 401
692    end
693    return apache2.OK
694 end
695 </pre></example>
696    <note><title>Ordering</title><p>The optional arguments "early" or "late" 
697    control when this script runs relative to other modules.</p></note>
698 </usage>
699 </directivesynopsis>
700
701 <directivesynopsis>
702 <name>LuaHookAccessChecker</name>
703 <description>Provide a hook for the access_checker phase of request processing</description>
704 <syntax>LuaHookAccessChecker  /path/to/lua/script.lua  hook_function_name [early|late]</syntax>
705 <contextlist><context>server config</context><context>virtual host</context>
706 <context>directory</context><context>.htaccess</context>
707 </contextlist>
708 <override>All</override>
709 <compatibility>The optional third argument is supported in 2.3.15 and later</compatibility>
710 <usage>
711 <p>Add your hook to the access_checker phase.  An access checker
712 hook function usually returns OK, DECLINED, or HTTP_FORBIDDEN.</p>
713    <note><title>Ordering</title><p>The optional arguments "early" or "late" 
714    control when this script runs relative to other modules.</p></note>
715 </usage>
716 </directivesynopsis>
717
718 <directivesynopsis>
719 <name>LuaHookInsertFilter</name>
720 <description>Provide a hook for the insert_filter phase of request processing</description>
721 <syntax>LuaHookInsertFilter  /path/to/lua/script.lua hook_function_name</syntax>
722 <contextlist><context>server config</context><context>virtual host</context>
723 <context>directory</context><context>.htaccess</context>
724 </contextlist>
725 <override>All</override>
726     <usage><p>Not Yet Implemented</p></usage>
727 </directivesynopsis>
728
729 <directivesynopsis>
730 <name>LuaInherit</name>
731 <description>Controls how parent configuration sections are merged into children</description>
732 <syntax>LuaInherit none|parent-first|parent-last</syntax>
733 <default>LuaInherit parent-first</default>
734 <contextlist><context>server config</context><context>virtual host</context>
735 <context>directory</context><context>.htaccess</context>
736 </contextlist>
737 <override>All</override>
738 <compatibility>2.4.0 and later</compatibility>
739     <usage><p>By default, if LuaHook* directives are used in overlapping
740     Directory or Location configuration sections, the scripts defined in the
741     more specific section are run <em>after</em> those defined in the more
742     generic section (LuaInherit parent-first).  You can reverse this order, or
743     make the parent context not apply at all.</p>
744     
745     <p> In previous 2.3.x releases, the default was effectively to ignore LuaHook*
746     directives from parent configuration sections.</p></usage>
747 </directivesynopsis>
748
749 <directivesynopsis>
750 <name>LuaQuickHandler</name>
751 <description>Provide a hook for the quick handler of request processing</description>
752 <syntax></syntax>
753 <contextlist><context>server config</context><context>virtual host</context>
754 <context>directory</context><context>.htaccess</context>
755 </contextlist>
756 <override>All</override>
757 <usage><p>...</p>
758    <note><title>Context</title><p>This directive is not valid in <directive
759    type="section" module="core">Directory</directive>, <directive
760    type="section" module="core">Files</directive>, or htaccess
761    context.</p></note>
762 </usage>
763 </directivesynopsis>
764
765 </modulesynopsis>