]> granicus.if.org Git - apache/blob - support/apxs.in
If we can't open httpd.conf, print a warning, but don't die.
[apache] / support / apxs.in
1 #!/usr/local/bin/perl
2 ## ====================================================================
3 ## Copyright (c) 1998-1999 The Apache Group.  All rights reserved.
4 ##
5 ## Redistribution and use in source and binary forms, with or without
6 ## modification, are permitted provided that the following conditions
7 ## are met:
8 ##
9 ## 1. Redistributions of source code must retain the above copyright
10 ##    notice, this list of conditions and the following disclaimer. 
11 ##
12 ## 2. Redistributions in binary form must reproduce the above copyright
13 ##    notice, this list of conditions and the following disclaimer in
14 ##    the documentation and/or other materials provided with the
15 ##    distribution.
16 ##
17 ## 3. All advertising materials mentioning features or use of this
18 ##    software must display the following acknowledgment:
19 ##    "This product includes software developed by the Apache Group
20 ##    for use in the Apache HTTP server project (http://www.apache.org/)."
21 ##
22 ## 4. The names "Apache Server" and "Apache Group" must not be used to
23 ##    endorse or promote products derived from this software without
24 ##    prior written permission. For written permission, please contact
25 ##    apache@apache.org.
26 ##
27 ## 5. Products derived from this software may not be called "Apache"
28 ##    nor may "Apache" appear in their names without prior written
29 ##    permission of the Apache Group.
30 ##
31 ## 6. Redistributions of any form whatsoever must retain the following
32 ##    acknowledgment:
33 ##    "This product includes software developed by the Apache Group
34 ##    for use in the Apache HTTP server project (http://www.apache.org/)."
35 ##
36 ## THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
37 ## EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
38 ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
39 ## PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
40 ## ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
42 ## NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
43 ## LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
44 ## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
45 ## STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
46 ## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
47 ## OF THE POSSIBILITY OF SUCH DAMAGE.
48 ## ====================================================================
49 ##
50 ## This software consists of voluntary contributions made by many
51 ## individuals on behalf of the Apache Group and was originally based
52 ## on public domain software written at the National Center for
53 ## Supercomputing Applications, University of Illinois, Urbana-Champaign.
54 ## For more information on the Apache Group and the Apache HTTP server
55 ## project, please see <http://www.apache.org/>.
56 ##
57
58 ##
59 ##  apxs -- APache eXtenSion tool
60 ##  Written by Ralf S. Engelschall <rse@apache.org>
61 ##
62
63 require 5.003;
64 use strict;
65 package apxs;
66
67 ##
68 ##  Configuration
69 ##
70
71 my $CFG_TARGET        = '@TARGET@';            # substituted via Makefile.tmpl 
72 my $CFG_CC            = '@CC@';                # substituted via Makefile.tmpl
73 my $CFG_CFLAGS        = '@CFLAGS@';            # substituted via Makefile.tmpl
74 my $CFG_CFLAGS_SHLIB  = '@CFLAGS_SHLIB@';      # substituted via Makefile.tmpl
75 my $CFG_LD_SHLIB      = '@LD_SHLIB@';          # substituted via Makefile.tmpl
76 my $CFG_LDFLAGS_SHLIB = '@LDFLAGS_MOD_SHLIB@'; # substituted via Makefile.tmpl 
77 my $CFG_LIBS_SHLIB    = '@LIBS_SHLIB@';        # substituted via Makefile.tmpl 
78 my $CFG_PREFIX        = '@prefix@';            # substituted via APACI install
79 my $CFG_SBINDIR       = '@sbindir@';           # substituted via APACI install
80 my $CFG_INCLUDEDIR    = '@includedir@';        # substituted via APACI install
81 my $CFG_LIBEXECDIR    = '@libexecdir@';        # substituted via APACI install
82 my $CFG_SYSCONFDIR    = '@sysconfdir@';        # substituted via APACI install
83
84 ##
85 ##  Cleanup the above stuff
86 ##
87 $CFG_CFLAGS =~ s|^\s+||;
88 $CFG_CFLAGS =~ s|\s+$||;
89 $CFG_CFLAGS =~ s|\s+`.+apaci`||;
90
91 ##
92 ##  parse argument line
93 ##
94
95 #   defaults for parameters
96 my $opt_n = '';
97 my $opt_g = '';
98 my $opt_c = 0;
99 my $opt_o = '';
100 my @opt_D = ();
101 my @opt_I = ();
102 my @opt_L = ();
103 my @opt_l = ();
104 my @opt_W = ();
105 my @opt_S = ();
106 my $opt_e = 0;
107 my $opt_i = 0;
108 my $opt_a = 0;
109 my $opt_A = 0;
110 my $opt_q = 0;
111
112 #   this subroutine is derived from Perl's getopts.pl with the enhancement of
113 #   the "+" metacharater at the format string to allow a list to be build by
114 #   subsequent occurance of the same option.
115 sub Getopts {
116     my ($argumentative, @ARGV) = @_;
117     my (@args, $first, $rest, $pos);
118     my ($errs) = 0;
119     local ($_);
120     local ($[) = 0;
121
122     @args = split( / */, $argumentative);
123     while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
124         ($first, $rest) = ($1,$2);
125         if ($_ =~ m|^--$|) {
126             shift(@ARGV);
127             last;
128         }
129         $pos = index($argumentative,$first);
130         if($pos >= $[) {
131             if($args[$pos+1] eq ':') {
132                 shift(@ARGV);
133                 if($rest eq '') {
134                     unless (@ARGV) {
135                         print STDERR "apxs:Error: Incomplete option: $first (needs an argument)\n";
136                         ++$errs;
137                     }
138                     $rest = shift(@ARGV);
139                 }
140                 eval "\$opt_$first = \$rest;";
141             }
142             elsif ($args[$pos+1] eq '+') {
143                 shift(@ARGV);
144                 if($rest eq '') {
145                     unless (@ARGV) {
146                         print STDERR "apxs:Error: Incomplete option: $first (needs an argument)\n";
147                         ++$errs;
148                     }
149                     $rest = shift(@ARGV);
150                 }
151                 eval "push(\@opt_$first, \$rest);";
152             }
153             else {
154                 eval "\$opt_$first = 1";
155                 if($rest eq '') {
156                     shift(@ARGV);
157                 }
158                 else {
159                     $ARGV[0] = "-$rest";
160                 }
161             }
162         }
163         else {
164             print STDERR "apxs:Error: Unknown option: $first\n";
165             ++$errs;
166             if($rest ne '') {
167                 $ARGV[0] = "-$rest";
168             }
169             else {
170                 shift(@ARGV);
171             }
172         }
173     }
174     return ($errs == 0, @ARGV);
175 }
176
177 sub usage {
178     print STDERR "Usage: apxs -g [-S <var>=<val>] -n <modname>\n";
179     print STDERR "       apxs -q [-S <var>=<val>] <query> ...\n";
180     print STDERR "       apxs -c [-S <var>=<val>] [-o <dsofile>] [-D <name>[=<value>]]\n";
181     print STDERR "               [-I <incdir>] [-L <libdir>] [-l <libname>] [-Wc,<flags>]\n";
182     print STDERR "               [-Wl,<flags>] <files> ...\n";
183     print STDERR "       apxs -i [-S <var>=<val>] [-a] [-A] [-n <modname>] <dsofile> ...\n";
184     print STDERR "       apxs -e [-S <var>=<val>] [-a] [-A] [-n <modname>] <dsofile> ...\n";
185     exit(1);
186 }
187
188 #   option handling
189 my $rc;
190 ($rc, @ARGV) = &Getopts("qn:gco:I+D+L+l+W+S+eiaA", @ARGV);
191 &usage if ($rc == 0);
192 &usage if ($#ARGV == -1 and not $opt_g);
193 &usage if (not $opt_q and not ($opt_g and $opt_n) and not $opt_i and not $opt_c and not $opt_e);
194
195 #   argument handling
196 my @args = @ARGV;
197 my $name = 'unknown';
198 $name = $opt_n if ($opt_n ne '');
199
200 if (@opt_S) {
201     my ($opt_S);
202     foreach $opt_S (@opt_S) {
203         if ($opt_S =~ m/^([^=]+)=(.*)$/) {
204             my ($var) = $1;
205             my ($val) = $2;
206             my $oldval = eval "\$CFG_$var";
207
208             unless ($var and $oldval) {
209                 print STDERR "apxs:Error: no config variable $var\n";
210                 &usage;
211             }
212
213             eval "\$CFG_${var}=\"${val}\"";
214         } else {
215             print STDERR "apxs:Error: malformatted -S option\n";
216             &usage;
217         }       
218     }
219 }
220
221 ##
222 ##  Initial shared object support check
223 ##
224 if (not -x "$CFG_SBINDIR/$CFG_TARGET") {
225         print STDERR "apxs:Error: $CFG_SBINDIR/$CFG_TARGET not found or not executable\n";
226         exit(1);
227 }
228 if (not grep(/mod_so/, `$CFG_SBINDIR/$CFG_TARGET -l`)) {
229     print STDERR "apxs:Error: Sorry, no shared object support for Apache\n";
230     print STDERR "apxs:Error: available under your platform. Make sure\n";
231     print STDERR "apxs:Error: the Apache module mod_so is compiled into\n";
232     print STDERR "apxs:Error: your server binary `$CFG_SBINDIR/$CFG_TARGET'.\n";
233     exit(1);
234 }
235
236 ##
237 ##  Operation
238 ##
239
240 #   helper function for executing a list of
241 #   system command with return code checks
242 sub execute_cmds {
243     my (@cmds) = @_;
244     my ($cmd, $rc);
245
246     foreach $cmd (@cmds) {
247         print STDERR "$cmd\n";
248         $rc = system("$cmd");
249         if ($rc != 0) {
250             printf(STDERR "apxs:Break: Command failed with rc=%d\n", $rc << 8);
251             exit(1);
252         }
253     }
254 }
255
256 if ($opt_g) {
257     ##
258     ##  SAMPLE MODULE SOURCE GENERATION
259     ##
260
261     if (-d $name) {
262         print STDERR "apxs:Error: Directory `$name' already exists. Remove first\n";
263         exit(1);
264     }
265
266     my $data = join('', <DATA>);
267     $data =~ s|%NAME%|$name|sg;
268     $data =~ s|%TARGET%|$CFG_TARGET|sg;
269
270     my ($mkf, $src) = ($data =~ m|^(.+)-=#=-\n(.+)|s);
271
272     print STDERR "Creating [DIR]  $name\n";
273     system("mkdir $name");
274     print STDERR "Creating [FILE] $name/Makefile\n";
275     open(FP, ">${name}/Makefile") || die;
276     print FP $mkf;
277     close(FP);
278     print STDERR "Creating [FILE] $name/mod_$name.c\n";
279     open(FP, ">${name}/mod_${name}.c") || die;
280     print FP $src;
281     close(FP);
282
283     exit(0);
284 }
285
286
287 if ($opt_q) {
288     ##
289     ##  QUERY INFORMATION 
290     ##
291
292     my $result = '';
293     my $arg;
294     foreach $arg (@args) {
295         my $ok = 0;
296         my $name;
297         foreach $name (qw(
298             TARGET CC CFLAGS CFLAGS_SHLIB LD_SHLIB LDFLAGS_SHLIB LIBS_SHLIB
299             PREFIX SBINDIR INCLUDEDIR LIBEXECDIR SYSCONFDIR
300         )) {
301             if ($arg eq $name or $arg eq lc($name)) {
302                 my $val = eval "\$CFG_$name";
303                 $result .= "${val}::";
304                 $ok = 1;
305             }
306         }
307         if (not $ok) {
308             printf(STDERR "apxs:Error: Invalid query string `%s'\n", $arg);
309             exit(1);
310         }
311     }
312     $result =~ s|::$||;
313     $result =~ s|::| |;
314     print $result;
315 }
316
317 if ($opt_c) {
318     ##
319     ##  SHARED OBJECT COMPILATION
320     ##
321
322     #   split files into sources and objects
323     my @srcs = ();
324     my @objs = ();
325     my $f;
326     foreach $f (@args) {
327         if ($f =~ m|\.c$|) {
328             push(@srcs, $f);
329         }
330         else {
331             push(@objs, $f);
332         }
333     }
334
335     #   determine output file
336     my $dso_file;
337     if ($opt_o eq '') {
338         if ($#srcs > -1) {
339             $dso_file = $srcs[0];
340             $dso_file =~ s|\.[^.]+$|.so|;
341         }
342         elsif ($#objs > -1) {
343             $dso_file = $objs[0];
344             $dso_file =~ s|\.[^.]+$|.so|;
345         }
346         else {
347             $dso_file = "mod_unknown.so";
348         }
349     }
350     else {
351         $dso_file = $opt_o;
352     }
353
354     #   create compilation commands
355     my @cmds = ();
356     my $opt = '';
357     my ($opt_Wc, $opt_I, $opt_D);
358     foreach $opt_Wc (@opt_W) {
359         $opt .= "$1 " if ($opt_Wc =~ m|^\s*c,(.*)$|);
360     }
361     foreach $opt_I (@opt_I) {
362         $opt .= "-I$opt_I ";
363     }
364     foreach $opt_D (@opt_D) {
365         $opt .= "-D$opt_D ";
366     }
367     my $cflags = "$CFG_CFLAGS $CFG_CFLAGS_SHLIB";
368     my $s;
369     foreach $s (@srcs) {
370         my $o = $s;
371         $o =~ s|\.c$|.o|;
372         push(@cmds, "$CFG_CC $cflags -I$CFG_INCLUDEDIR $opt -c $s");
373         unshift(@objs, $o);
374     }
375
376     #   create link command
377     my $cmd = "$CFG_LD_SHLIB $CFG_LDFLAGS_SHLIB -o $dso_file";
378     my $o;
379     foreach $o (@objs) {
380         $cmd .= " $o";
381     }
382     $opt = '';
383     my ($opt_Wl, $opt_L, $opt_l);
384     foreach $opt_Wl (@opt_W) {
385                 if($CFG_LD_SHLIB ne "gcc") {
386                 $opt .= " $1" if ($opt_Wl =~ m|^\s*l,(.*)$|);
387                 } else {
388                 $opt .= " -W$opt_Wl";
389                 }
390     }
391     foreach $opt_L (@opt_L) {
392         $opt .= " -L$opt_L";
393     }
394     foreach $opt_l (@opt_l) {
395         $opt .= " -l$opt_l";
396     }
397     $cmd .= $opt;
398     $cmd .= " $CFG_LIBS_SHLIB";
399     push(@cmds, $cmd);
400
401     #   execute the commands
402     &execute_cmds(@cmds);
403
404     #   allow one-step compilation and installation
405     if ($opt_i or $opt_e) {
406         @args = ( $dso_file );
407     }
408 }
409
410 if ($opt_i or $opt_e) {
411     ##
412     ##  SHARED OBJECT INSTALLATION
413     ##
414
415     #   determine installation commands
416     #   and corresponding LoadModule/AddModule directives
417     my @lmd = ();
418     my @amd = ();
419     my @cmds = ();
420     my $f;
421     foreach $f (@args) {
422         if ($f !~ m|\.so$|) {
423             print STDERR "apxs:Error: file $f is not a shared object\n";
424             exit(1);
425         }
426         my $t = $f;
427         $t =~ s|^.+/([^/]+)$|$1|;
428         if ($opt_i) {
429             push(@cmds, "cp $f $CFG_LIBEXECDIR/$t");
430             push(@cmds, "chmod 755 $CFG_LIBEXECDIR/$t");
431         }
432
433         #   determine module symbolname and filename
434         my $filename = '';
435         if ($name eq 'unknown') {
436             $name = '';
437             my $base = $f;
438             $base =~ s|\.[^.]+$||;
439             if (-f "$base.c") {
440                 open(FP, "<$base.c");
441                 my $content = join('', <FP>);
442                 close(FP);
443                 if ($content =~ m|.*module\s+(?:MODULE_VAR_EXPORT\s+)?([a-zA-Z0-9_]+)_module\s*=\s*.*|s) {
444                     $name = "$1";
445                     $filename = "$base.c";
446                     $filename =~ s|^[^/]+/||;
447                 }
448             }
449             if ($name eq '') {
450                 if ($base =~ m|.*mod_([a-zA-Z0-9_]+)\..+|) {
451                     $name = "$1";
452                     $filename = $base;
453                     $filename =~ s|^[^/]+/||;
454                 }
455             }
456             if ($name eq '') {
457                 print "apxs:Error: Sorry, cannot determine bootstrap symbol name\n";
458                 print "apxs:Error: Please specify one with option `-n'\n";
459                 exit(1);
460             }
461         }
462         if ($filename eq '') {
463             $filename = "mod_${name}.c";
464         }
465         my $dir = $CFG_LIBEXECDIR;
466         $dir =~ s|^$CFG_PREFIX/?||;
467         $dir =~ s|(.)$|$1/|;
468         push(@lmd, sprintf("LoadModule %-18s %s", "${name}_module", "$dir$t"));
469         push(@amd, sprintf("AddModule %s", $filename));
470     }
471
472     #   execute the commands
473     &execute_cmds(@cmds);
474
475     #   activate module via LoadModule/AddModule directive
476     if ($opt_a or $opt_A) {
477         if (not -f "$CFG_SYSCONFDIR/$CFG_TARGET.conf") {
478             print "apxs:Error: Config file $CFG_SYSCONFDIR/$CFG_TARGET.conf not found\n";
479             exit(1);
480         }
481
482         open(FP, "<$CFG_SYSCONFDIR/$CFG_TARGET.conf") || die;
483         my $content = join('', <FP>);
484         close(FP);
485
486         if ($content !~ m|\n#?\s*LoadModule\s+|) {
487             print STDERR "apxs:Error: Activation failed for custom $CFG_SYSCONFDIR/$CFG_TARGET.conf file.\n";
488             print STDERR "apxs:Error: At least one `LoadModule' directive already has to exist.\n";
489             exit(1);
490         }
491
492         my $lmd;
493         my $c = '';
494         $c = '#' if ($opt_A);
495         foreach $lmd (@lmd) {
496             my $what = $opt_A ? "preparing" : "activating";
497             if ($content !~ m|\n#?\s*$lmd|) {
498                  $content =~ s|^(.*\n#?\s*LoadModule\s+[^\n]+\n)|$1$c$lmd\n|sg;
499             } else {
500                  $content =~ s|^(.*\n)#?\s*$lmd[^\n]*\n|$1$c$lmd\n|sg;
501             }
502             $lmd =~ m|LoadModule\s+(.+?)_module.*|;
503             print STDERR "[$what module `$1' in $CFG_SYSCONFDIR/$CFG_TARGET.conf]\n";
504         }
505         my $amd;
506         foreach $amd (@amd) {
507             if ($content !~ m|\n#?\s*$amd|) {
508                  $content =~ s|^(.*\n#?\s*AddModule\s+[^\n]+\n)|$1$c$amd\n|sg;
509             } else {
510                  $content =~ s|^(.*\n)#?\s*$amd[^\n]*\n|$1$c$amd\n|sg;
511             }
512         }
513         if (@lmd or @amd) {
514             if (open(FP, ">$CFG_SYSCONFDIR/$CFG_TARGET.conf.new")) {
515                 print FP $content;
516                 close(FP);
517                 system("cp $CFG_SYSCONFDIR/$CFG_TARGET.conf $CFG_SYSCONFDIR/$CFG_TARGET.conf.bak && " .
518                        "cp $CFG_SYSCONFDIR/$CFG_TARGET.conf.new $CFG_SYSCONFDIR/$CFG_TARGET.conf && " .
519                        "rm $CFG_SYSCONFDIR/$CFG_TARGET.conf.new");
520             } else {
521                 print STDERR "unable to open configuration file\n";
522             }
523         }
524     }
525 }
526
527 ##EOF##
528 __DATA__
529 ##
530 ##  Makefile -- Build procedure for sample %NAME% Apache module
531 ##  Autogenerated via ``apxs -n %NAME% -g''.
532 ##
533
534 #   the used tools
535 APXS=apxs
536 APACHECTL=apachectl
537
538 #   additional defines, includes and libraries
539 #DEF=-Dmy_define=my_value
540 #INC=-Imy/include/dir
541 #LIB=-Lmy/lib/dir -lmylib
542
543 #   the default target
544 all: mod_%NAME%.so
545
546 #   compile the shared object file
547 mod_%NAME%.so: mod_%NAME%.c
548         $(APXS) -c $(DEF) $(INC) $(LIB) mod_%NAME%.c
549
550 #   install the shared object file into Apache 
551 install: all
552         $(APXS) -i -a -n '%NAME%' mod_%NAME%.so
553
554 #   cleanup
555 clean:
556         -rm -f mod_%NAME%.o mod_%NAME%.so
557
558 #   simple test
559 test: reload
560         lynx -mime_header http://localhost/%NAME%
561
562 #   install and activate shared object by reloading Apache to
563 #   force a reload of the shared object file
564 reload: install restart
565
566 #   the general Apache start/restart/stop
567 #   procedures
568 start:
569         $(APACHECTL) start
570 restart:
571         $(APACHECTL) restart
572 stop:
573         $(APACHECTL) stop
574
575 -=#=-
576 /* 
577 **  mod_%NAME%.c -- Apache sample %NAME% module
578 **  [Autogenerated via ``apxs -n %NAME% -g'']
579 **
580 **  To play with this sample module first compile it into a
581 **  DSO file and install it into Apache's libexec directory 
582 **  by running:
583 **
584 **    $ apxs -c -i mod_%NAME%.c
585 **
586 **  Then activate it in Apache's %TARGET%.conf file for instance
587 **  for the URL /%NAME% in as follows:
588 **
589 **    #   %TARGET%.conf
590 **    LoadModule %NAME%_module libexec/mod_%NAME%.so
591 **    <Location /%NAME%>
592 **    SetHandler %NAME%
593 **    </Location>
594 **
595 **  Then after restarting Apache via
596 **
597 **    $ apachectl restart
598 **
599 **  you immediately can request the URL /%NAME and watch for the
600 **  output of this module. This can be achieved for instance via:
601 **
602 **    $ lynx -mime_header http://localhost/%NAME% 
603 **
604 **  The output should be similar to the following one:
605 **
606 **    HTTP/1.1 200 OK
607 **    Date: Tue, 31 Mar 1998 14:42:22 GMT
608 **    Server: Apache/1.3.4 (Unix)
609 **    Connection: close
610 **    Content-Type: text/html
611 **  
612 **    The sample page from mod_%NAME%.c
613 */ 
614
615 #include "httpd.h"
616 #include "http_config.h"
617 #include "http_protocol.h"
618 #include "ap_config.h"
619
620 /* The sample content handler */
621 static int %NAME%_handler(request_rec *r)
622 {
623     r->content_type = "text/html";      
624     ap_send_http_header(r);
625     if (!r->header_only)
626         ap_rputs("The sample page from mod_%NAME%.c\n", r);
627     return OK;
628 }
629
630 /* Dispatch list of content handlers */
631 static const handler_rec %NAME%_handlers[] = { 
632     { "%NAME%", %NAME%_handler }, 
633     { NULL, NULL }
634 };
635
636 /* Dispatch list for API hooks */
637 module MODULE_VAR_EXPORT %NAME%_module = {
638     STANDARD_MODULE_STUFF, 
639     NULL,                  /* module initializer                  */
640     NULL,                  /* create per-dir    config structures */
641     NULL,                  /* merge  per-dir    config structures */
642     NULL,                  /* create per-server config structures */
643     NULL,                  /* merge  per-server config structures */
644     NULL,                  /* table of config file commands       */
645     %NAME%_handlers,       /* [#8] MIME-typed-dispatched handlers */
646     NULL,                  /* [#1] URI to filename translation    */
647     NULL,                  /* [#4] validate user id from request  */
648     NULL,                  /* [#5] check if the user is ok _here_ */
649     NULL,                  /* [#3] check access by host address   */
650     NULL,                  /* [#6] determine MIME type            */
651     NULL,                  /* [#7] pre-run fixups                 */
652     NULL,                  /* [#9] log a transaction              */
653     NULL,                  /* [#2] header parser                  */
654     NULL,                  /* child_init                          */
655     NULL,                  /* child_exit                          */
656     NULL                   /* [#0] post read-request              */
657 };
658