Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

migrated from stackoverflow.com Oct 10 '11 at 17:35

This question came from our site for professional and enthusiast programmers.

    
Make sure that TEST folder is also writeable to the group. –  Usman Saleem Oct 10 '11 at 14:39

2 Answers 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).

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.