Welcome, guest | Sign In | My Account | Store | Cart

mod_perl defines a package called Apache::ReadConfig. Here it keeps all the variables that you define inside the <Perl> sections.

Perl, 19 lines
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
apache_config.pl
  ---------------- 
  package Apache::ReadConfig;
  
  $ServerName = `hostname`;
  if ( $ServerName !~ /^secure/) {
    $UserDir = "/var/www/httpdocs/";
  } else {
    $UserDir = "DISABLED";
  }
  
  1;

  httpd.conf
  ----------
  PerlRequire /var/www/httpdocs/perl/lib/apache_config.pl
  $Apache::Server::StrictPerlSections = 1
/usr/lib/apache/mod_include_modperl.so
/usr/sbin/httpdocs_modperl