johnmont
2004-11-10, 10:50 AM
This is probably a fairly basic question regarding permissions, and there are probably better places to ask online, but I'll give it a shot....
On my site, I have the facility to allow file uploads (http-based) for only selected, approved users. Generally, a folder is created by the server and the files are uploaded within this folder.
Also, the domainuser has ftp access to the upload folder and I want the web server to be able to add folders, overwrite the files or add files to the folder.
The problem is, I want the files that are uploaded via http to be accessible by the normal plesk web user and vice versa. So files uploaded via ftp are
user: domainuser
group: psacln
And those via the web are:
user: apache
group: apahce
So one user can't change the other users items...I've figured a few workarounds using php to chmod, but you can't do a chown or chgrp. I've changed the default umask to be 002 (I understand the implications of that) and then changed the httpd process to run as user apache, group psacln -- at least then I'd be covered under group access. But this is not the best thing to do if if start adding virtual hosts, etc. Also, certain apps such as mailmain are required to be running as apache and not psacln.
The bottom line....the domain user and apache user need to be able to change/access files uploaded by each other.
Any pointers to tutorials dealing with this? Any suggestions or personal experiences?
On my site, I have the facility to allow file uploads (http-based) for only selected, approved users. Generally, a folder is created by the server and the files are uploaded within this folder.
Also, the domainuser has ftp access to the upload folder and I want the web server to be able to add folders, overwrite the files or add files to the folder.
The problem is, I want the files that are uploaded via http to be accessible by the normal plesk web user and vice versa. So files uploaded via ftp are
user: domainuser
group: psacln
And those via the web are:
user: apache
group: apahce
So one user can't change the other users items...I've figured a few workarounds using php to chmod, but you can't do a chown or chgrp. I've changed the default umask to be 002 (I understand the implications of that) and then changed the httpd process to run as user apache, group psacln -- at least then I'd be covered under group access. But this is not the best thing to do if if start adding virtual hosts, etc. Also, certain apps such as mailmain are required to be running as apache and not psacln.
The bottom line....the domain user and apache user need to be able to change/access files uploaded by each other.
Any pointers to tutorials dealing with this? Any suggestions or personal experiences?