wood burning stoves 2.0*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat File writing permissions" Watch "Tomcat File writing permissions" New topic
Author

Tomcat File writing permissions

Jonny Carlos
Greenhorn

Joined: Oct 25, 2004
Posts: 2
Hi,

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
Greenhorn

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/startup.sh"

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: http://aspose.com/file-tools
 
subject: Tomcat File writing permissions
 
Similar Threads
Error starting Tomcat in Ubuntu
Linux Tomcat: java.net.BindException: Permission denied:80
Start Tomcat 7 as tomcat user (not root user)
Servlets work, JSPs do not...
Creating group permissions with Java