Hi All,
(This message is VERY long --I'm trying to include as much information as I
can)
Back on June 3 I posted a message about a problem I was having installing
custom configuration directives. Since then, I have been going over
everything with a fine tooth comb -- which was probably not worth the
effort at all because the whole process (at least as explained in the eagle
book) is a piece of cake. Basically, perl does all the hard work and all I
do is a couple of tables.
Last night I rebuilt apache and mod_perl (versions 1.3.12 and 1.23
respectively -- mod_perl being compiled in and not a dso) in order to build
mod_perl with the PERL_TRACE option, and also to discover if there was
something flaky in the previous build. If the latter is the case, the
flakiness carried over since it still fails.
Basically, when you invoke httpd as a daemon, it starts up successfully,
parses the httpd.conf file, finds no problem and returns with an exit code
of '0', meaning that it found no problem and forked off the daemonm copy.
Thus, apachectl reports that apache was successfully started. Howver, the
daemon dies quickly and reports in the error_log:
MirrorWiseKeyFile', perhaps mis-spelled or defined by a module not
included in the server configuration
If I actually mess with the directive, spell it wrong or add or remove an
argument, when apache originally parses the httpd.conf file it finds reason
to complain, and apachectl does not come back and report a successful
startup. Rather, it report an error, run "apachectl configtest" to see the
error. Also, when I add various debug hooks into the callback for the
directive, I can confirm that it's being invoked and getting the argument
(it's a TAKE1). So, whatever is going on is something else, and it's
happening after the initial fork.
I have included the debug output below, tracing was set to "all".
> [root@cheshire apache]# bin/httpd -X
> perl_parse args: '/dev/null' ...allocating perl interpreter...ok
> constructing perl interpreter...ok
> ok
> running perl interpreter...ok
> mod_perl: 0 END blocks encountered during server startup
> PerlRequire: arg=`conf/startup.pl'
> attempting to require `conf/startup.pl'
> loading perl module 'Apache::Constants::Exports'...ok
> perl_cmd_fresh_restart: 1
> perl_cmd_setenv: 'PERL_DESTRUCT_LEVEL' = '-1'
> perl_cmd_setenv: 'DBMauthFile' = 'private/authen/passwdMD5'
> loading perl module 'Apache'...ok
> PerlModule: arg='Apache::MirrorWise'
> loading perl module 'Apache::MirrorWise'...ok
> init `PerlHandler' stack
> perl_cmd_push_handlers: @PerlHandler, 'Apache::MirrorWise'
> pushing `Apache::MirrorWise' into `PerlHandler' handlers
> blessing cmd_parms=(0xbfffda68)
However, in the error log we read:
> Syntax error on line 16 of /usr/local/apache/conf/perl.conf:
> Invalid command 'MirrorWiseKeyFile', perhaps mis-spelled or defined by a
> module not included in the server configuration
This is the perl.conf file that contains the directive:
> PerlRequire conf/startup.pl
> PerlFreshRestart On
>
> #
> # SetHandler perl-script
> # PerlHandler Apache::Hello
> #
> #
> PerlSetEnv PERL_DESTRUCT_LEVEL -1
> PerlSetEnv DBMauthFile private/authen/passwdMD5
> #
> PerlModule Apache::MirrorWise
> SetHandler perl-script
> PerlHandler Apache::MirrorWise
> #
> MirrorWiseKeyFile conf/keyfile
>
Anybody have any ideas?
Thanks,
Rob
ATTACHED HISTORY:
Here follows the original post and a dialogue I had with another member of
the list. His suggestions were helpful, but did not resolve the issue.
> 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' },
> {
> 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