[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: add httpd.conf directive




suppressed wrote:
I'm running mp1 with PerlAccessHandler handler.
I want to add some config directive into httpd.conf,and let my module use them for passing auth.
ie,in httpd.conf I add these lines,

PassAuthIPs    12.34.56.78  23.45.67.89

Then the requests from these IPs would get past.

Isn't that easier to do with the following standard Apache directives (independently of mod_perl) ?
<location  /xyz>
  Deny from all
  Allow from (list of IP's)
</location>

If the above is not applicable, then you could use something like
<location /xyz>
  PerlSetVar AllowedIps "ip1 ip2 ip3"
  ...
</location>

and in your module do

sub handler {
  my $r = shift; # the request object
  my $AllowedIps = $r->dir_config('AllowedIps') || ''; # get "ip1 ip2 ip3"
  ...
}
and I guess there must be a function in mod_perl to get the IP from which the request is coming, to compare.

Hope this helps.


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.