J
J
jidckii2015-01-20 13:35:35
linux
jidckii, 2015-01-20 13:35:35

How to change umask for www-data user in debian 7?

Good day to all.
Actually there is Debian 7, the Nginx + Php-fpm bundle is used.
The www-data user creates files with permissions 644 , but I would like 664.
I tried to write a php-fpm script in init like here . Also create www-data
.profile in the home directory with umask, but it doesn't work either. Who knows how to do it?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
J
jidckii, 2015-01-21
@jidckii

Generally understood.
In the initialization script there is an address for accessing /etc/default/php5-fpm
this file was not there.
Created it, specified umask, rebooted the profit daemon !!!)

E
Eugene, 2015-01-20
@Nc_Soft

In /etc/php-fpm.conf add
umask 0002

A
Anton Robul, 2015-11-24
@anton_slim

Only not in /etc/php-fpm.conf but in the startup script /etc/init.d/php5-fpm
upd: I found another way indicated here stackoverflow.com/questions/35851049/how-to-set-um.. for debian and php5-fpm service: 1.
Edit /etc/systemd/system/multi-user.target.wants/php5-fpm.service file and add UMask=0002 to the [Service] section.
2. Run systemctl daemon-reload
3. Run systemctl restart php5-fpm.service
The service file now looks like this:
[Unit]
Description = The PHP FastCGI Process Manager
After = network.target
[Service]
Type = notify
PIDFile = /var /run/php5-fpm.pid
ExecStartPre = /usr/lib/php5/php5-fpm-checkconf
ExecStart = /usr/sbin/php5-fpm --nodaemonize --fpm-config /etc/php5/fpm/php-fpm.conf
ExecReload = /bin/kill -USR2 $MAINPID
; Added to set umask for files created by PHP
UMask = 0002
[Install]
WantedBy =
multi-user.target but I like the /etc/default/php5-fpm way more

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question