Plesk and the naughty Apache user
I use Plesk for one of my servers and have had this problem for a while now were certain files and directories could not be removed via the Plesk File Manager or FTP, permission denied. These files were created by Joomla when I installed a module through one of it’s admin pages. The problem with this is that it creates the files with the Apache user as the owner. This means Plesk can’t delete them. Turns out this was due to me being a dumn user. Inside Plesk go to Domains->Name of your domain->Web Hosting Settings. Under Services where I have PHP Support ticked I also have it set to run as an Apache Module. The simple fix is to change this to run as a CGI Application. It’s a trade-off between performance and ease of use. Now when things are created via a CMS admin page they will be done so with the default Plesk user, the tradeoff is that it’s a wee bit more sucky when it comes to performance. For now I’m not concerned about that, convenience wins.
That sorts it out for future use but it doesn’t help if you’ve already broken things. To sort the permissions out on files that are already set to Apache you will need to connect via SSH. I use Putty to do this. You have to get the connection settings from your service provider. Once in you have to navigate to the domain directory that the naughty files are in.
Then to change the owner you do: chown username directory. Say my user name was ted and the directory with the crapped out files in is called www I’d do: chown ted www.
You can change the group with: chgrp groupname www e.g. if the group name was ducks then you would do: chgrp ducks www.
You can make both of those recursive if you really messed things up with: chown -R ted www and chgrp -R ducks www.
To change the permissions you can do: chmod -R 755 www which means the owner can write/modify/delete but other users can just view stuff.