tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kimberly Begley" <kimberly.le...@gmail.com>
Subject permissions to read/write files outside webapps directory?
Date Wed, 02 Apr 2008 22:00:44 GMT
Hi,
I've just deployed my webapp on the remote server (tomcat5 and red hat
linux) - everything is displaying properly but when the user uploads a file
for processing it is failing - looking in the log files it appears that
tomcat can't read or write files outside the webapps directory by these
error messages:

java.io.FileNotFoundException:
/home/kimberly/test/cases/85/85-settings.txt(Permission denied)

Permissions on this directory are readable by everyone and I thought tomcat
would be able to write/read  to the tomcat5/temp directory but that doesn't
appear to be happening either.

I want it to read 1000's of files from my home directory and when uploading
files to write them to the temp file in /usr/share/tomcat5/temp/test. This
works great on my local copy but isn't working on the remote server.

So from what I gather online I need to edit the catalina.policies file to
allow read/write access to the appropriate directories. Before I go messing
around with the policies file for the first time I wanted to double check
that this is appropriate as well as check the syntax.

// Example policy file entry

grant [signedBy <signer>,] [codeBase <code source>] {
  permission  <class>  [<name> [, <action list>]];
};


So syntax would be something like:
grant codeBase "file:${catalina.home}/temp" permission
java.io.FilePermission, "read,write";
grant codeBase "file:/home/kimberly/test/cases"
permission.java.io.FilePermission, "read";

And then do I just restart tomcat?
Please any advice would be greatly appreciated.
Thanks!

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message