douquanqiao6788
douquanqiao6788
2016-08-10 12:02
采纳率: 100%
浏览 292
已采纳

Nginx将新文件www-data设置为所有者而不是我的用户

I have a question regarding file permissions. I created a new user with sudo, and set the directory to chown (username). So far so good, only now the situation: When the system (magento2) creates new files, or I upload via magento 2 new files, the owner is 'www-data' instead of magento2 username.

Question:

What Do I need to do that every new file that magento will create or the file that I upload via magento will get the owner as: magento2 instead of www-data?

Server:

Ubuntu 16.04 Nginx 1.10 PHP7

I created the user like this:

  1. adduser magento2
  2. usermod -aG sudo magento2

Then I chownd like this:

  1. sudo chown -R magento2:www-data /home/magento2

  2. sudo find /home/magento2 -type d -exec chmod g+s {} \;

Thanks in advance,

HRR

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

相关推荐