Linux下Apache設置上傳文件時候的默認權限(umask) :linux
方法一:apache
Apache/Php umask determines the permissions for the newly created files. On a VPS / Dedicated server you can change the umask to suit your specific needs by editing:網站
/usr/local/apache/bin/envvarsui
There you should add:spa
umask 022rest
Right after that restart Apache and Apache/Php's default umask will become 22.server
方法二:htm
For CentOS and other Red Hat distros, add the umask setting to /etc/sysconfig/httpd and restart apache.ci
[root ~]$ echo "umask 002" >> /etc/sysconfig/httpdit
[root ~]$ service httpd restart
本篇文章來源於 Linux公社網站(www.linuxidc.com) 原文連接:http://www.linuxidc.com/Linux/2011-01/31393.htm