Perl cgi-bin and Apache 
Author Message
 Perl cgi-bin and Apache

Dear perl admins and programmers,
after writing some perl programs to be used as cgi-bin from an Apache Web
Server, we were asked to protect some URLs through Apache Authorization
depending on the QUERY_STRING value. Do you know whether it is possible
either through Apache configuration or Perl ?
Our problem arises from the fact that the <Location> directive of Apache
conf file only grabs the URL, not its parameters.
Any suggestions ?


Sun, 16 May 2004 11:50:54 GMT  
 Perl cgi-bin and Apache

Quote:
> Dear perl admins and programmers,
> after writing some perl programs to be used as cgi-bin from an Apache Web
> Server, we were asked to protect some URLs through Apache Authorization
> depending on the QUERY_STRING value. Do you know whether it is possible
> either through Apache configuration or Perl ?

So long as Apache is configured to require a valid user you can have
your script throw a 401 error is the user in question is not allowed
to access the data.

This has nothing do with Perl and would better have been asked in a
group relating to CGI programming.

In Perl the impelementation would look something like:

unless ( is_allowed(remote_user)) {
  print header({status=>401,'WWW-Authenticate' =>"Basic realm=\"Whatever\""});
  exit;

Quote:
}
> Our problem arises from the fact that the <Location> directive of Apache
> conf file only grabs the URL, not its parameters.
> Any suggestions ?

If I were you I'd stop using QUERY_STRING and start using PATH_INFO
for these parameters.  This of course has nothing to do with Perl.

Oh, and please stop spamming.  Post your question once.  Crosspost if
appropriate.  Never post separately to two or more groups unless you
have a overwhelmingly strong reason to do so.  "I forgot to crosspost"
is _not_ an overwhelmingly strong reason.

--
     \\   ( )
  .  _\\__[oo

 .  l___\\
  # ll  l\\
 ###LL  LL\\



Sun, 16 May 2004 20:09:22 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Perl cgi-bin and Apache authorization

2. text/plain Perl files in cgi-bin on Apache (Win32)

3. Apache/perl cgi-bin question ?

4. Apache/perl cgi-bin question ?

5. Apache server not recognising perl scripts in cgi-bin

6. perl in cgi-bin of apache in win98 won't work

7. using a CGI-bin script with an apache proxy server

8. What does the BIN in cgi-bin mean?

9. /usr/bin/perl vs /usr/local/bin/perl

10. #!/usr/local/bin/perl -w || /usr/bin/perl -w

11. Failed to execute script 'cgi-bin/news/index_home.cgi': Win32 Error Code = 87

12. cgi-lib.pl-unknown content-type when cgi-bin passworded

 

 
Powered by phpBB® Forum Software