Fixing broken wordpress uploads folders, Even on shared hosting for many sites.
by Chris Walker on Apr.21, 2010,under Technical, How To, Programming, Bash Scripting, General, Skills, Portfolio, Automation, Linux, Unix, Software, Wordpress, Plesk
Again, here I am, solving some of the weirdest stuff with shared hosting and the support that comes with it. In Plesk, each client is given a hierarchy of users, Most of these apply only to accessing certain things such as the plesk control panel in some form or fashion. However, two of them, allow filesystem access. FTP and Web Users can access their own area on the server for ftp'ing information. When anything is placed here its created as [user who uploaded]:psacln. This is secure because the psacln group doesnt have access to anything. And the user who uploaded data, only has access to this folder.
Follow up:
I've never really messed with wordpress. I have friends who do, and unfortunately, clients on these shared hosting servers. We do not actually support wordpress, however we do have to support parts of our system that cause wordpress to not function correctly.
When a user uploads files in wordpress, they are created in a directory called wp-content/uploads/[year]/[month]/. If either this year or month folder do not exist, wordpress will create them. This is usually good. Except on a shared hosting server, the user that runs apache, is, well, apache. Apache runs in the group apache as well. When wordpress has the system create the folder, it creates it as apache:apache, causing the folder to not be writable by the plesk file manager, ftp, or even wordpress itself. For a single wordpress blog, this is not a problem [though it can become time consuming to have to handle this once a month]. For more than 30 wordpress sites.. this is a disaster.
In an effort to prevent this. I've written a script to take care of this. Not just for one, but for many as well. [keep going]
Pages: 1 · 2

5 comments
This post has 3 feedbacks awaiting moderation...
Leave a comment