You need to tell Apache it's okay to execute stuff in that directory
with the Options ExecCGI directive.  Try adding something like this to
Apache's config file.

<Directory /usr/local/mailman/cgi-bin/>
    AllowOverride None
    Options ExecCGI
    Order allow,deny
    Allow from all
</Directory>


It's easy to introduce security vulnerabilities this way, so Apache
wants to be sure this is okay to execute.


In general, you can check Apache's error log.  Any error that would have
shown up when run from a shell gets redirected there.  Try something
like 

tail -f /var/log/httpd/error_log 




-----Original Message-----
From: tclug-list-bounces at mn-linux.org
[mailto:tclug-list-bounces at mn-linux.org] On Behalf Of Donovan Niesen
Sent: Wednesday, June 06, 2007 06:47
To: tclug-list at mn-linux.org
Subject: [tclug-list] apache, mod_perl and creating files from perl
scripts

I have been troubleshooting a basic perl script that writes to a file.
 I'm able to run the script from the shell and the script creates the
file with no problem.  However when I run the same script from a
browser, it is unable to create the file.

I'm running Apache with mod_perl enabled.  I've set chmod 777 on the
directory containing the script but still it cannot create a file.
I've tried creating the output file and giving it 777 permissions as
well, but the script will not append to it either.

Here is the contents of script I've been testing with:

#!/usr/bin/perl

open (IPLOG,">>ip.log") or die("could not create file");
print IPLOG $ENV{'REMOTE_ADDR'}."\n";
close(IPLOG);


I feel like I'm missing something basic here...


-- 
Donovan Niesen

_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
tclug-list at mn-linux.org
http://mailman.mn-linux.org/mailman/listinfo/tclug-list