Hi all,

I'm trying to create several custom configuration directives, and have
pretty mucg followed the eample in the eagle book (pp 387-394).

I start Apache up -- get no configuration complaints and apachectl comes
back saying Apache started.  The info messages in the error log,
however, indicate otherwise.  To wit: 

Invalid command 'MirrorWiseKeyFile', perhaps mis-spelled or defined by a
module not included in the server configuration

In Makefile.PL, I include:          
my @directives = (
                  { name         => 'MirrorWiseKeyFile',
                    errmsg       => 'location of password DB key file',
                    args_how     => 'TAKE1',
                    req_override => 'OR_ALL' },
                  {
                    <a second directive here but not yet 
                        added to httpd.conf>  },
                 );

command_table(\@directives);

# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
              'NAME'              => __PACKAGE__,
              'VERSION_FROM'      => 'MirrorWise.pm',
              'INC'               => Apache::src->new->inc,
              'INSTALLSITEARCH'   => $install_here,
              'INSTALLSITELIB'    => $install_here,
             );

1;

The $install_here, above, is simply a scalar set to the module root 
in the Apache doc root (currently: /usr/local/apache/lib/perl).

In the module, I include:

if ( $ENV{'MOD_PERL'} ) {
  no strict;
  @ISA = qw(DynaLoader);
  __PACKAGE__->bootstrap($VERSION);
}


# Configuration Processing Callbacks

sub MirrorWiseKeyFile ($$$) {
  my($cfg, $parms, $keyfile) = @_;
  $cfg->{MirrorWiseKeyFile} = $keyfile;
}

Right now I'm not doing anything fancy in the callback -- I'm just
trying to read the value.  It's actually the name of a file that must 
be opened with root privilege, so that will get added later.

If I comment out DynaLoader or mess up the directive's syntax (e.g.,
give it two args, not one), the startup complains, for example:

MirrorWiseKeyFile takes one argument, location of password DB key file

The complaint prints to my screen, and it's just what I would expect. 
It 
suggests to me that Apache is reading and correctly parsing the
directive.
Moreover, I can add a print statement in the callback and confirm both
that it is being called and that it is getting the proper value from the
directive in the httpd.conf file.

But take the print statements out, uncomment DynaLoader and fix the
syntax,
and apachectl starts up apache with no complaints whatsoever, and comes
back with httpd started.  Yet the error_log still says the directive is
invalid.

I'm using perl 5.6, mod_perl 1.23 and apache 1.3.12. Mod_perl is
compiled
in to the server.

Any clues?  Thanks.

-- Rob


       _ _ _ _           _    _ _ _ _ _
      /\_\_\_\_\        /\_\ /\_\_\_\_\_\
     /\/_/_/_/_/       /\/_/ \/_/_/_/_/_/  QUIDQUID LATINE DICTUM SIT,
    /\/_/__\/_/ __    /\/_/    /\/_/          PROFUNDUM VIDITUR
   /\/_/_/_/_/ /\_\  /\/_/    /\/_/
  /\/_/ \/_/  /\/_/_/\/_/    /\/_/         (Whatever is said in Latin
  \/_/  \/_/  \/_/_/_/_/     \/_/              appears profound)
  
  Rob Tanner
  McMinnville, Oregon
  [EMAIL PROTECTED]

Reply via email to