You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Nirjhareswar Banerjee <ni...@radixtechnologies.com> on 2003/03/17 22:39:22 UTC
[users@httpd] problem in custom log pipe with cgi script for red hat 8
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