设置Apache用户的umask [英] Setting the umask of the Apache user
问题描述
我正在设置 LAMP 服务器,并希望将 Apache 的 umask 设置设置为 002,以便所有 Apache 创建的文件都设置了组写入权限位(因此同一组的成员可以覆盖文件).
I am setting up a LAMP server and would like to set Apache's umask setting to 002 so that all Apache-created files have the group write permission bit set (so members of the same group can overwrite the files).
有人知道怎么做吗?我知道在 Ubuntu 上,您可以使用/etc/apache2/envvars 文件来配置 umask,但服务器运行的是 CentOS.
Does anyone know how to do this? I know that on Ubuntu, you can use the /etc/apache2/envvars file to configure the umask, but the server is running CentOS.
更新这个问题与我不久前问的另一个问题有关(Linux 用户和组用于 LAMP 服务器).如果愿意,请更新另一个问题,使用最佳设置来让开发人员用户在可以编辑 apache 用户创建的文件的服务器上使用.
Update This question is related to another I asked a while ago (Linux users and groups for a LAMP server). If prefered, please update this other question with what the best set-up is to use for having a developer user on a server that can edit files created by the apache user.
推荐答案
Apache 从其父进程(即启动 Apache 的进程)继承其 umask
;这通常应该是 /etc/init.d/
脚本.因此,在该脚本中放置一个 umask
命令.
Apache inherits its umask
from its parent process (i.e. the process starting Apache); this should typically be the /etc/init.d/
script. So put a umask
command in that script.
这篇关于设置Apache用户的umask的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!