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 have one directory called apps/cache. When a script writes some files to that directory those files are owned by the nobody user. Of course, then those files and folders are not editable by any user.

Is there any way that I can change the user nobody?

share|improve this question

3 Answers 3

Use suEXEC within Apache to run your scripts as an appropriate user.

Also, consider learning a lot about setuid. A lot.

share|improve this answer
    
I did that chmod g+s directory. Now what that did is make the new folders with group of the cache directory. Then i tried umask 002 cache so that i can get default group write permission. But its not doing that –  user825904 Jan 9 '12 at 5:14
    
@user1094163 Do you want to change how apache behaves in the first place, or try and get the situation as it stands now to work? The answer I gave is to make apache and scripts behave better, but not how to get things to work now that the folder and files are under the nobody user. –  Wesley Jan 9 '12 at 6:14
    
Thats apache thing is looking bit tough for me. can you solve my current problem as per now –  user825904 Jan 10 '12 at 7:30

Check your configuration (apache) for the directive User. This is where you set the user apache starts and operates in the first place.

share|improve this answer

check these variables in your configuration folder and change accordingly

x@x:~$ grep www-data /etc/apache2/ -R
/etc/apache2/envvars:export APACHE_RUN_USER=www-data
/etc/apache2/envvars:export APACHE_RUN_GROUP=www-data
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.