[NTLUG:Discuss] apache config problem

Russ Brewer brewer at adelphia.net
Sat May 20 05:03:46 CDT 2000


I have a small web page that has been running fine on apache.  I am
trying to move it to an appache_ssl secure server running on the same
machine.

To enter the site there is a simple html page with a form (post method)
that collects a login name and password. Upon submit, the action
statement calls file.pl which parses the form, comparing $FORM{name} and
$FORM{password}
to stored values and if they match, displays some welcome html.  If they
dont match it displays some "access denied" html.

This all works fine with the regular apache server. But on the secure
server, the variables from the login page are not being received by the
perl
script.  The parsing function is applied to variable $cache (see
function below) and it is always an empty value. Thus the parsing
function reports that $FORM{name} and $FORM{password} are empty values
and the user is always presented with the access denied display portion
of file.pl.

$cache, is a variable that should be holding the raw POST data from the
fill in fields in the login form.

sub parse_form {
read(STDIN, $cache, $ENV{'CONTENT_LENGTH'});
   if (length($cache) < 5) {
         $buffer = $ENV{QUERY_STRING};
    }

  @pairs = split(/&/, $cache);

   foreach $pair (@pairs) {
      ($name, $value) = split(/=/, $pair);

      $value =~ tr/+/ /;
      $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

        if (defined($FORM{$name})){
        $FORM{$name}.="\0";
        }

      $FORM{$name} .= $value;
   }

The problem seems to be that (when running on the secure server) $cache
(from the function above) is empty and thus parsing $cache results in
$FORM{name} and $FORM{password} being empty.  On the regular server,
$cache is not empty and the parsing function works just fine.

Why would $cache hold the correct form data on the regular apache server
but always be empty on the secure apache server?

Russ Brewer




More information about the Discuss mailing list