0

We have a MediaTemple dedicated virtual running Plesk. The problem we're having is that changing the permissions of files on the server to be writable by server owner (apache) is conflicting with the ability to upload and overwrite files via the FTP user.

Here's an example, I upload a file from user "serverftp" and they own the new file in the httpdocs folder. I then change the permission of an image upload folder to the apache user to that I can upload images via a PHP script. Uploading or changing that folder with the serverftp user is then locked out.

Speaking to tech support didn't get very far because there are some strange group permissions going on and it would involve me adding every single domain FTP user to the pcantl group or something similar.

I'm wondering how I can easily change things so that I don't have this problem anymore.

1 Answers1

1

You can set umask for the users and a common group. An alternative is to use dnotify.

Here are some details for a similar thing: How do I set permissions structure for multiple users editing multiple sites in /var/www on Ubuntu 9.10?

Mircea Vutcovici
  • 16,706
  • 4
  • 52
  • 80
  • How do you set unmask for a group? How can you make sure that the nobody or apache user is part of this group? –  Apr 08 '11 at 01:15
  • The umask is specific to each process and can be set at login time by pam_umask or trough /etc/login.defs. To set the umask for a group I've added a script in `/etc/profile.d/` that will test for the group and sets the mask: `grep -q ^group_name:.*$(id -un) /etc/group&&umask 002`. To test if apache or nobody are not in that group you can use: `egrep -q '^group_name:.*(apache|nobody)' /etc/group&& echo Houston, we\'ve had a problem.` – Mircea Vutcovici Apr 08 '11 at 20:07