Help - Search - Members - Calendar
Full Version: Apache and Root files
The Planet Forums > Control Panels > Plesk
nibb
I dont remember since when but lately from time to time a user complains that when he install an application some folder or files the user root or apache assigned so they cannot deleted it or modify it. Its normally with files or folders created by a script or php, does someone else has this problem? Is it a plesk bug?
Squire
A root file? No, they shouldn't be that. But files created by a script will end up with apache as the owner since technically it's apache that's creating the new file.

You could of course add a line or three to the script to set the owner, group and even the chmod. I mention the last because I don't believe php always saves files with a 0644 permissions.

Or if they couldn't alter the script that does the saving because it's some commercial application, they could whip is a small script to loop through files and directories to make sure each is set properly. Since Apache will be the owner when it runs there shouldn't be any permission problems.

If you're talking a php script, they've examples of using chown, chmod and such in their manual.
doc
QUOTE (nibb @ Apr 17 2007, 05:51 PM) *
I dont remember since when but lately from time to time a user complains that when he install an application some folder or files the user root or apache assigned so they cannot deleted it or modify it. Its normally with files or folders created by a script or php, does someone else has this problem? Is it a plesk bug?


I had this problem with a php script I wrote. You could create folders and upload images to them. The only downside was I could not delete them via FTP, I had to log into SSH and delete them that way. No idea why.

My box is cPanel/RHEL4.
nibb
QUOTE (doc @ Apr 18 2007, 09:19 AM) *
I had this problem with a php script I wrote. You could create folders and upload images to them. The only downside was I could not delete them via FTP, I had to log into SSH and delete them that way. No idea why.

My box is cPanel/RHEL4.

Yes same here.
ideasmultiples
Is normal, if file is created from http: owner is apache and only owner (or root) can delete.

Use chown and chmod for change permissions after create files
nibb
Yes the solution is of course change then as root, but thats not a fast solution if you have to do it on per basis issue o per customer. I did not had this problems with server that had plesk 7, it started at version 8 and now most customers cant change their files via ftp that where created on script installations.
doc
QUOTE (nibb @ Apr 18 2007, 11:08 AM) *
Yes the solution is of course change then as root, but thats not a fast solution if you have to do it on per basis issue o per customer. I did not had this problems with server that had plesk 7, it started at version 8 and now most customers cant change their files via ftp that where created on script installations.


I wonder if this is an apache thing, not Plesk because my cPanel box does this. Maybe a newer version of apache is causing the permissions issue.

Thanks for the info ideasmultiples. I will try to change the permission of all folders created and files uploaded via the script and see if that solves the issue.
nibb
Cpanel. MMM, so year then i was probably wrong and its a Apache issue. But im sure i did not had this before, not so repeated like now. Its really annoying every time a customer wants to deleted this folder he was to create a ticket.
ideasmultiples
Not is really a issue, the treatment of the permissions in UNIX works thus with or without panel , if script of apache creates a file is its owner while one does not change
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.