***** infoCopter.com/perl *****
Apache Config
If there is a syntax error in the Perl code causing it to fail during compilation, Apache will report the problem and the server will not start.
You can now directly syntax check the configuration file using the Perl interpreter's -cx switches. -c makes Perl perform a syntax check, and -x tells the interpreter to ignore all junk prior to the #!perl line: % perl -cx httpd.conf httpd.conf syntax OK
If the Apache configuration generated from your Perl code produces a syntax error, this message will be sent to the server error log, but
the server will still start. In general, it is always a good to look at the error log after starting the server to make sure startup went smoothly.
If you have not picked up this good habit already, we strongly recommend you do so when working with
Another helpful trick is to build mod_perl with the PERL_TRACE configuration option set to true. Then, when the enviroment variable
MOD_PERL_TRACE is set to s, httpd will output diagnostics showing how the
Another tool that is occasionally useful is the Apache::PerlSections module. It defines two public routines named dump() and store().
dump() dumps out the current contents of the Apache::PerlSections requires the Perl Devel::Symdump and Data::Dumper modules, both available on CPAN. Here is a simple example of its use:
< Perl>
#!perl
use Apache::PerlSections();
$User = 'nobody';
$VirtualHost{'192.168.2.5:80'} = {
ServerName => 'www.fishfries.org',
DocumentRoot => '/home/httpd/fishfries/htdocs',
ErrorLog => '/home/httpd/fishfries/logs/error.log',
TransferLog => '/home/httpd/fishfries/logs/access.log',
ServerAdmin => 'webmaster@fishfries.org',
};
print STDERR Apache::PerlSections->dump();
__END__
< /Perl>
|