I'm trying to configure my Apache config file using Perl Sections. I'm
stuck in trying to populate a Directory directive with a bunch of "Allow
from"s like so:

## Get my "allow froms" from an existing list of ip addresses
 my $accessfile =
'/usr/local/etc/apache_1.3.12/conf/accesscontrol.conf';
    open ACCESS, $accessfile or die "$accessfile : $!\n";
    my @allows = ();
    while (<ACCESS>) {
          push @allows, {Allow => "from $1" } if  /^Allow from (.+)/;
    }
    close ACCESS;

   ### This is the part that i'm not sure of
    $Directory{'/home/mydirectory'} = {
     Order => 'deny,allow',
     Deny  => 'from all',
     @allows,
    };

I get the following Error message when I start the server:
<Perl>: Invalid command 'HASH(0x268cec)', perhaps mis-spelled or defined
by
 a module not included in the server configuration

I am running Apache 1.3.12 mod_perl 1.21 on UNIX. Built with
EVERYTHING=1. btw, my other Perl Section'ed
configuration are working...

Unfortunately the docs only show examples of single Allow froms, which
doesn't tell me if I should put the "Allow from $ip" in a hash or an
array reference:

@allows = { Allow => "from $ip"} or Allow => ["from $ip1", from "$ip2",
...,"from $ipN"]



Thanks,

Carlos


-- 
Claiming that your operating system is the best in the world because
more people use it is like saying
McDonalds makes the best food in the world.

Reply via email to