0

i used tomcat+cpanel in linux os . i set the tomcat group of a file but tomcat can not write to my file . the permission my file is 664 . the os setting is :

root@panther [/home/domain/public_html]# ls -la  
total 36
drwxr-x--- 4 domain nobody 4096 Oct 9 15:18 ./
drwx--x--x 11 domain domain 4096 Oct 9 15:17 ../
drwxr-xr-x 5 tomcat nobody 4096 Oct 8 19:26 ROOT/
drwxr-xr-x 5 jbeanir jbeanir 4096 Oct 17 2011 TEST/

the url of page is domain/TEST/newjsp2.jsp

please help me

2 Answers2

2

If you are attempting to create a file in the TEST directory, please remember that you must have permissions in the directory to "write" to the directory.

In other words, if this file doesn't exist, change the directory permissions of TEST to rwxrwxr-x and you should be able to create it.

Note that you haven't checked to see which owner the tomcat web server is running as, odds are it is tomcat. If that is so, then you might want to make TEST owned (or at least group owned) by tomcat.

Finally, Tomcat is a bit of an environment in itself. In order for this to have much of a chance of working correctly, you need to read up on the layout of a WAR file, and how Tomcat unpacks that into the applications directory, and odds are that's where you really want to be dropping your file (if you have configured tomcat to allow such activities).

Edwin Buck
  • 257
  • 1
  • 4
0

The permission of /home/domain/public_html is 750, which means that only the owner and group can use it. If tomcat is not a member of the "nobody" group, then tomcat won't be able to access any files in that directory or its subdirectories. You should change /home/domain/public_html to mode 751 or 755.

And, as others have said, if you're trying to create a file in the TEST directory, then tomcat must have write permissions in that directory.

Jonathan
  • 633
  • 1
  • 5
  • 5