File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Tomcat File writing permissions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat File writing permissions" Watch "Tomcat File writing permissions" New topic

Tomcat File writing permissions

Jonny Carlos

Joined: Oct 25, 2004
Posts: 2

I have two seperate machines running solaris...
- both are running Apache 1.3
- one running Tomcat 4, the other Tomcat 5
The java requests are being proxied through Apache -> mod_jk - > Tomcat

I have been having trouble with the permissons of files written by tomcat. This includes log file's, as well as files written by users jsp code.

Previously, all logs and tmp files written by jsp's had default permissions of 644 (rw-r--r--), and are owned by user/group 'tomcat'. This effectively means tomcat can write to what it needs to, and everyone else can read the files.

Recently, both tomcat instances have been sporadically writting files under 600 permissions (only readable by the user 'tomcat') which is a problem for people wanting to read files created by tomcat, who are not the root user.

Does anyone know what would cause this? I never configured any type of umask settings under tomcat previously... but am not sure if this even exists. Could it even occur from servers being under a heavy load? I eliminated that it could just be the users jsp code which is changing permissions somehow, but even the log files are affected bvy this strange behaviour.

any help will be appreciated.
Jonny Carlos

Joined: Oct 25, 2004
Posts: 2
Ummmm, I have seen on some startup scripts for tomcat (/etc/init.d) have a umask 0022 setting up top... Would this actually affect the permissions of files written by tomcat?? i.e. within the startup script the command to start the tomcat process is:

su tomcat -c "/path/to/tomcat/"

soo.. would this umask setting in the startup script actually apply to all files etc written to by the user tomcat ?? (even though tomcat is su 'ed to?)
I agree. Here's the link:
subject: Tomcat File writing permissions
It's not a secret anymore!