Apache::PerlSections(3pm)

Apache::PerlSections3pm

Utilities for work with <perl> sections

Usage

    use Apache::PerlSections ();

Overview

It is possible to configure you server entirely in Perl using <Perl> sections in httpd.conf. This module is here to help you with such a task.

Methods

dump

This method will dump out all the configuration variables mod_perl will be feeding the the apache config gears. The output is suitable to read back in via "eval".

Example:

 <Perl>
 use Apache::PerlSections ();
 $Port = 8529;
 $Location{"/perl"} = {
     SetHandler => "perl-script",
     PerlHandler => "Apache::Registry",
     Options => "ExecCGI",
 };
 @DocumentIndex = qw(index.htm index.html);
 $VirtualHost{"www.foo.com"} = {
     DocumentRoot => "/tmp/docs",
     ErrorLog => "/dev/null",
     Location => {
         "/" => {
             Allowoverride => 'All',
             Order => 'deny,allow',
             Deny  => 'from all',
             Allow => 'from foo.com',
         }, 
     },
 };
 print Apache::PerlSections->dump;
 </Perl>

This will print something like so:

 package Apache::ReadConfig;
 #scalars:
 $Port = 8529;
 #arrays:
 @DocumentIndex = (
   'index.htm',
   'index.html'
 );
 #hashes:
 %Location = (
   '/perl' => {
     PerlHandler => 'Apache::Registry',
     SetHandler => 'perl-script',
     Options => 'ExecCGI'
   }
 );
 %VirtualHost = (
   'www.foo.com' => {
     Location => {
       '/' => {
         Deny => 'from all',
         Order => 'deny,allow',
         Allow => 'from foo.com',
         Allowoverride => 'All'
       }
     },
     DocumentRoot => '/tmp/docs',
     ErrorLog => '/dev/null'
   }
 );
 1;
 __END__
store

This method will call the "dump" method, writing the output to a file, suitable to be pulled in via "require".

Example:

   Apache::PerlSections->store("httpd_config.pl");
   require 'httpd_config.pl';

Releases

5 releases since Debian 2.1 (Slink); the text changed 4 times.

  1. 2.1
  2. 2.2
  3. 3.0
  4. 3.1
  5. 4.0

Author

Doug MacEachern

From libapache-mod-perl 1.29.0.4-4.1+etch1 in Debian 4.0 (Etch). Parsed by carta from the page's man source.