2

I'm not too familiar with file ownership etc. in Linux but here's my problem. I log into my ubuntu (dev machine) which is local as let's say user abc group xyz.

Now files that reside under /var/www/vhosts/abc.com/htdocs when created are owned by abc:xyz. In order for web server to run them I have to do sudo chown -R www-data:www-data . which works like a charm. Problem is that I can't edit these files with my text editor since these files are not owned by abc:xyz.

Ideally I want my web server group to be replaced with abc and group to be replaced with xyz (if possible) so that files are both editable through IDE and executable by the web server user. I don't like the idea of symlinking files/directories from elsewhere.

Any advice on this will be greatly appreciated.

Devtype
  • 123

1 Answers1

1

You can change the user apache runs as - from www-data to whatever fits you best. However, I wouldn't advise you to do that. Or at least you should select a dedicated user for apache - user that won't be used for anything else.

The better option is to make www-data user a member of xyz group. That way apache will be able to read/execute whatever needed (just don't forget that your directories in /var/www/ must have +x for the group, all scripts and files will be fine with +r for group).

13dimitar
  • 935