permissions for file written by script

I'm trying to write a perl script to write a file that will be readable by a tomcat program.  The script is admin.pl in a cgi-bin directory of a domain and the file has owner fv88 and group psacln.  The file I'm trying to a file (home.jsp) in a subdir of the tomcat4 directory.  Files in that directory have the owner as root and group as tomcat4.

I've tried the following without success:
1. chmod home.jsp to 777.  This is a plesk server with umask of 022, and plesk doesn't like 777 (but I don't know if that matters here or not).
2. added fv88 to the tomcat4 group.

How can I configure things so the script admin.pl will overwrite home.jsp?

msibley
msibleyAsked:
Who is Participating?
 
owensleftfootConnect With a Mentor Commented:
The user that the script runs as will need write access to the directory  home.jsp is in.
0
 
msibleyAuthor Commented:
Wouldn't either of 1 or 2 above have done that?  Do scripts run as a different user than the owner of the script file?
msibley
0
 
msibleyAuthor Commented:
figured it out . . . it was a permissions problem in a directory up the tree.

Thanks anyway, I'll give you the pts.

msibley
0
 
jeffparisCommented:
in php, I know I have to do this before chmodding:

            $o_umask = umask(0);
                  

And this after chmodding:
            umask($o_umask);


0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.