Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have to access/write directories through php that are created by tomcat by upload process.

php apache:apache cant able to access tomcat:tomcat directories.

Please tell me what i should change to work it out.

share|improve this question
up vote 1 down vote accepted

One option is to put the apache user in the tomcat group. Another option is to create a new group, say webusers, in which you put both the apache and the tomcat users, and to which you assign the group ownership of the affected tomcat directories.

The affected tomcat directories will then have to be writable by group. It's probably also a good idea to add the setgid bit, making sure new files and directories are created with the right group ownership.

Also remember to set an umask inside the involved scripts, to get the desired permissions on new files and directories. I guess you want 002 or 007, depending if the files should be accessible by any user or not.

share|improve this answer

Your Answer


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.