The problem here is that most web servers give the outside world acces to
files under the WWW root directory.  Since /tmp is not one of the
directories under the WWW root you can't get to it.

I have never done this myself but you might want to try to make a symbolic
link in the WWW root directory to the /tmp directory, like this (this
assumes you are in the WWW root dir):

ln -s /tmp tmp

The only drawback to this is that now anyone can access your /tmp directory.
You may want to consider making a subdirectoy such as /tmp/log and linking
that(also in WWW root):

ln -s /tmp/logs logs

Hope this helps!
Ken
----- Original Message -----
From: "Nichole Bialczyk" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 04, 2001 3:33 PM
Subject: i'm warning you, this is a toughie!


> the bossman has requested the following:
>
> he wants my logfiles written to our server in the /tmp directory. my
> scripts are in the cgi-bin of our afs account. even though the files are
> set with 777 permissions, the outside world can not write to these files.
> here is part of one of my scripts:
>
> #don't log these machines into the logfile
> my @my_addr = qw(r-squirrel.cc.umr.edu poohbear.cc.umr.edu
vixen.cc.umr.edu
> helix.cc.umr.edu);
>
> #determine the name and location of the logfile
> my $logfile = "/tmp/newlog.txt";
>
> #if the user is one of our machines, don't login
> foreach my $address(@my_addr) {
>    if ($ENV{'REMOTE_HOST'} eq $address) {
>       &redir;
>       exit;
>    }
> }
>
> &log;
> &redir;
> exit;
>
> sub log {
>    unless (open(LOG,">>$logfile")) {
>       print "Content-type: text/html\n\n";
>       print "Couldn't open $logfile\n";
>       exit;
>    }
>    #the logfile is opened
>
>
> etc, etc
>
> if you can solve this one, then i declare you resident genius of perl.
> (at least until i come up with another problem)
>
> :) nichole
>

Reply via email to