0

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?

4 Answers 4

1

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

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

3
  • 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
    – Mirage
    Jan 9, 2012 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, 2012 at 6:14
  • Thats apache thing is looking bit tough for me. can you solve my current problem as per now
    – Mirage
    Jan 10, 2012 at 7:30
0

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

0

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
0

Some Centos setups may have Apache settings under "httpd"

  1. make a backup of /etc/httpd/conf/httpd.conf
  2. edit /etc/httpd/conf/httpd.conf
  3. find the lines starting with User and Group - create them if they don't exist.

    User mycustomapacheuser
    Group mycustomapachegroup
    

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .