Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User rights setup, Tomcat and Apache users both need access to a dir

Status
Not open for further replies.

zeeshan12

Programmer
Jan 5, 2006
12
GB
Hi,

I have a user rights issue that I need some help with and would appreciate any solutions/suggestions.

I have to run an app which has a few servlets that run through tomcat and some php files that are on apache web server. Code in all scripts and servlets need to access a directory on the system. The problem is, if the directory has been created by tomcat, apache cannot write into it and if apache creates a dir tomcat doesn't have write permission in it.

There is probably a very easy solution to this but I'm not very good with linux. I am running an enterprise linux 5 box.


Thanks
 
Perhaps create a group to which both belong and set the permissions to the directory (666, rw-rw-rw-) so that the group has write access to the directory. This is what I would consider using old-school unixes, linux may be different of course!

The internet - allowing those who don't know what they're talking about to have their say.
 
I have tried something similar and added tomcat user to apache's group. They both get access to the main dir which is chmod'ed to 775.
The problem occures when either tomcat or apache create a directory within that main directory. That then becomes read-only for the other user apart from the one who created it.

so for example if tomcat creates a directory within that main dir then only tomcat has write permissions in it.

 
You probably need to consider setting umask for each so that they can both create directories with the appropriate permissions to allow what you wish.

The internet - allowing those who don't know what they're talking about to have their say.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top