On Monday 25 Apr 2005 02:04, Mr Prince Simon wrote:
> Hi,
> 
> I have a simple question and maybe someone can explain
> to me what happend.
> 
> I have a perl script 
> ---
> #!/usr/bin/perl -w
> print "Content-type: text/html\n\n";
> my $hashcommand ="clamscan -r -i -l
> /home/clamav/scan.txt /www/pathtomydir/";
> system($hashcommand);
> 
> print "done";
> exit;
> 
> ---
> and when I manually run it from the command prompt (
> login as root )
> it work fine.
> 
> But when I run it thru the website, its not working.
> i already added group apache to clamsv in the group
> file
> ---
> apache:x:48:clamav
> ---
> 
> It has to be rights issue. but I have no idea where to
> begin..

You've given no information about your system. Engaging my ESP chip here:
if it's RH Linux look in /var/log/httpd/error.log, if it's Debian, in 
/var/log/apache/error.log.
If it's something else, who knows.

Check "clamscan" is in the path for Apache.

Did you "chmod +x" your script.

You say that the output is HTML, but then print a plain text "done", so either
print HTML as you say you will, or get the content-type right. Most browsers 
may still work
by guessing, but you can't bet on it.

Never ever use "system" in a CGI script that's open to the public or worse still
your fellow employees.

If you set hashcommand to "ls -l", does *that* appear? If not, then it's an 
Apache question
so ask in an Apache place.

> thanks again for all your help
> 
> Simon

-- 
Nigel Horne. Arranger, Composer, Typesetter.
NJH Music, Barnsley, UK.  ICQ#20252325
[EMAIL PROTECTED] http://www.bandsman.co.uk
_______________________________________________
http://lurker.clamav.net/list/clamav-users.html

Reply via email to