> -----Original Message-----
> From: Gunnar Hjalmarsson [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 9:19 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Write to file with shared server certificate
>
>
> Ron Goral wrote:
> > I need to write to a log file to record things happening in a cgi
> > script. The environment is secured using a server-wide, shared
> > certificate.  I cannot write to the file and get an error telling
> > me I do not have the proper permissions to do so.
>
> So, why don't you change the file permissions? Maybe it's 644 right
> now, and it's likely that 666 is needed since it's a CGI script.
>
> > The log file is in my web's directory, but using the shared cert.
> > requires a path like so:
> >
> > https://secure.hostname.com/mydomain/cgi-bin/logs/logfile.log
> > rather than:
> > https://www.mydomain.com/cgi-bin/logs/logfile.log
>
> Those are not paths on the file system, they are two different URLs
> that happen to be mapped to the same file. It has nothing to do with
> the problem to write to the log file.
>
> --
> Gunnar Hjalmarsson
> Email: http://www.gunnar.cc/cgi-bin/contact.pl
>

Gunnar -

chmod 0666 is the right thing.  Thank you.  However, I am not able to do
that programmatically when the script is running in secure mode. The
following dies:

$file_path = qq[/usr/wwws/htdocs/mydomain/cgi-bin/logs/errs.log];
chmod 0666,$file_path or die "Cannot chmod $file_path - $!";

However, in "unsecure" mode, this succeeds:

$file_path = qq[/home/username/mydomain-www/cgi-bin/logs/errs.log];
chmod 0666,$file_path or die "Cannot chmod $file_path - $!";

Thanks for the help -
Ron Goral



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to