httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nirjhareswar Banerjee <nirjhares...@radixtechnologies.com>
Subject [users@httpd] problem in custom log pipe with cgi script for red hat 8
Date Mon, 17 Mar 2003 21:39:22 GMT
hello,

i am in a bit trouble, i am using redhat 8 in default setup. in the 
httpd.conf, for a name based virtual host i have changed as

CustomLog "| /home/projects/projects/test/cgi-bin/mysqllog" common

and the structure of the file is


 #!/usr/bin/perl
use DBI;


use constant DSN       => 'dbi:mysql:test';
use constant DB_TABLE  => 'access_log';
use constant DB_USER   => 'nir';
use constant DB_PASSWD => 'nir12';


$PATTERN = '([A-Za-z0-9 .-_]+)';


$db = DBI->connect(DSN,DB_USER,DB_PASSWD) || die DBI->errstr;
$sth = $db->prepare("INSERT INTO ${\DB_TABLE} VALUES(?)") || die 
$db->errstr;
while (<>)
{
    chomp;
    my($data) = /$PATTERN/o;
    $sth->execute($data);
}
$sth->finish;
$db->disconnect;


when i run the script from cui, it works fine, but does not work with 
the pipe... then i tried this to figure out if the pipe option at all 
works....

CustomLog "| /usr/bin/gzip -c >> 
/home/projects/projects/test/logs/access_log.gz" common

it yeilds nothing.... would anyone please help me to sort the problem out.?

Thanks  & Regards
Nir


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message