How do I change the user that the Apache web server runs under in CentOS?

12,079

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

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

Share:
12,079

Related videos on Youtube

Mirage
Author by

Mirage

Updated on September 18, 2022

Comments

  • Mirage
    Mirage over 1 year

    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?

  • Mirage
    Mirage over 12 years
    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
  • Wesley
    Wesley over 12 years
    @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.
  • Mirage
    Mirage over 12 years
    Thats apache thing is looking bit tough for me. can you solve my current problem as per now