Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- joe hacker
November 28, 2005, 1:36 am
rate this thread
Fedora Core 4
Sorry for the pitiful amount of Perl content, but someone here
will know the answer. Do I really need to do all this to log to
file in mp2/Apache2?
I have a cgi/web script that I run under the ModPerl::Registry handler. I
want to open a file handle and print info to that handle. I don't want to
use Apache's builtin abilities -- only the old fashion way.
It appears that Mod_perl scripts run under the same user as
Apache2, which is apache:apache. OK so far.
The first time I run my script, I run it in the console as root.
This creates the log file (mylog.dat) as root:root. I then do
chown apache:apache mylog.dat
chmod 0664 mylog.dat
After all that I can log normally. If I don't change the owner
of the log file, then the script dies when trying to open the log.
Is this approach optimal or necessary? I'm new to Linux.
thanks for your advice,