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.
Related videos on Youtube
Author by
Mirage
Updated on September 18, 2022Comments
-
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 thenobody
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 over 12 yearsI did that
chmod g+s directory
. Now what that did is make the new folders with group of the cache directory. Then i triedumask 002 cache
so that i can get default group write permission. But its not doing that -
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 over 12 yearsThats apache thing is looking bit tough for me. can you solve my current problem as per now