Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 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: http://serverfault.com/questions/127658/how-do-i-set-permissions-structure-for-multiple-users-editing-multiple-sites-in/127686#127686

share|improve this answer
    
How do you set unmask for a group? How can you make sure that the nobody or apache user is part of this group? –  user77617 Apr 8 '11 at 1: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 8 '11 at 20:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.