in reply to Apache & Perl CGI Directory Permissions
/home/test/10 is not inside my DocumentRoot which is /home/web so it gives me a Permission denied error.That's an incorrect analysis. CGI scripts can do whatever the user the scripts are run as can. E.g.:
use warnings; use strict; use CGI qw(:standard); print header(); print start_html(-title=>"Nasty"); open(FOO, "<", "/etc/passwd") or die "Couldn't open\n"; print <FOO>; close(FOO); print end_html();
The above prints out my passwd file, albeit with dodgy line endings, but that's irrelevant. The reason it can do this is because my webserver user has read access to the passwd file. The problem you're most likely facing is that www can't write to /home/test. Try copying the file first to test this. Hint: you could use the File::Copy module, which is in core.
|
|---|