Worth Nginx + Apache + Php-Fpm on debian 8. Recently I reinstalled some server packages including apache. As a result, flew the rights to the site files. Scripts cannot be recorded (only from 777), and old files (eg pictures) cannot be overwritten. As I found out, the problem was not in the rights, but in the group. Before that it was and everything was written well.

drwxrwxr-x 5 userst userst 4427776 июл 3 16:10 upload 

I tried to change the userst group to www-data ( chown userst:www-data upload ), and the scripts started writing as before. vipw gives the vipw data:

 ... www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin ... userst:x:501:501:db_userst:/var/www/userst/data:/bin/bash ... 

Is it possible to somehow give userst same rights as www-data ?

I tried to add userst to the www-data group.

I checked /etc/group like there is a www-data:x:33:userst , but the scripts cannot write failed to open stream: Permission denied .

    1 answer 1

    The answer does not pull, but you just need to add the user www-data to the userst group.

    • this does not work. I tried and so and so - Max_Payne 3:42 pm
    • Does the script itself exactly their www-data floor work? - Naumov
    • I exhibited permissions for the script that writes and for the directory. With userst:userst does not write, and with userst:www-data writes. It used to always be userst:userst . Never cheated. - Max_Payne
    • In apache settings, which user and group are defined. And in general you have the same php-fpm, see pool.d/www see the group and user for the pool. Maybe it used to work for you from userst:userst and when installing apache, some other interpreter that works from www-data got up ... - Naumov userst:userst
    • costs user = www-data group = www-data I and nginx work from www-data and have always worked from www-data . Never changed it. The problem is most likely that userst lost its rights. - Max_Payne