cancel
Showing results for 
Search instead for 
Did you mean: 

[PAYH] How do you change the owner and the group for a file or directory

gilbertG
Dabbler
Posts: 23
Registered: ‎16-01-2009

[PAYH] How do you change the owner and the group for a file or directory

I have upload some files and want them to be writable by the user that php runs as but I can't find a way in Plesk to change the group or the owner so my only option seems to be to make them world writable which is not a nice solution.
Anyone know how to do a chown or chgrp in PAYH (preferably chown/chgrp -R)
5 REPLIES 5
Kev_Mawson
Grafter
Posts: 196
Registered: ‎05-04-2007

Re: [PATH] How do you change the owner and the group for a file or directory

Hi
You can run shell commands by using cron, please take a look at the link below:
http://usertools.plus.net/tutorials/id/68
spraxyt
Superuser
Superuser
Posts: 10,063
Thanks: 1,369
Fixes: 75
Registered: ‎06-04-2007

Re: [PATH] How do you change the owner and the group for a file or directory

I think it is worth mentioning that you can only change the owner of a file/directory if you are root, and unless you are root you can only change the group to one you are a member of. That somewhat restricts your scope with doing anything with these commands.
David
Gabe
Community Veteran
Posts: 767
Registered: ‎29-10-2008

Re: [PATH] How do you change the owner and the group for a file or directory

It's a roundabout way of doing it, but:
If you have off-line copies of the folders and files, you can upload them with a PHP script (such as webadmin.php) and that will get them owned by www-data. If they're just in your PAYH space, dowload them using FTP and load them back up again using webadmin.php (or similar).
Gabe
gilbertG
Dabbler
Posts: 23
Registered: ‎16-01-2009

Re: [PATH] How do you change the owner and the group for a file or directory

Both of the solutions suggested sound like workarounds, but neither is particularly pleasant.
Could the httpdocs dir not be set up with it's sticky bit set for the group so it's the www-data group instead of psacln (whatever that is).
gilbertG
Dabbler
Posts: 23
Registered: ‎16-01-2009

Re: [PAYH] How do you change the owner and the group for a file or directory

In the end I wrote a script to recursively copy the uploaded data so that it would have the right permissions and ownership but that failed due to SAFE MODE restrictions.