package Apache::IPfilter; use Apache::Constants qw(:common); sub handler { my $r = shift; return DECLINED unless $r->is_initial_req(); my $calling_ip = $r->get_remote_host(); for my $ip ( $r->dir_config->get('allowed_ip') ) { return OK if $ip eq $calling_ip; } warn( 'Denied access to, ', $r->uri(), ', by caller ', $calling_ip, " not in access list.\n" ); return FORBIDDEN; } 1;