I have had a many WordPress blogs over the years installed on shared hosting and have had little problem installing and managing them. I used a great auto upgrade plugin before automatic upgrades came to WordPress in version 2.7 (I think). But even with automatic upgrading of versions and plugins, having many blogs, it still took some manageing to make sure all my blogs were up-to-date and secure. So I planned for the what I saw as the Holy Grail of a WordPressMU (now Multisite option) install on a virtual server to combine all (or at least most) of the blogs I manage onto one server therefore one time upgrade of versions and plugins.
For reasons better none to me at the time and partially explained on this post I started from LAMP configured Ubuntu 10.04 server install (my server of choice). After some initial issues problems were solved the WordPress 3.0 with Multi Site install, with the domain mapping plugin appeared to be all configured correctly. Not till slightly later did I find that I could not upgrade the plugins automatically (one of the prime reason for having the WordPressMU configuration). The error message I got was as below but basically it appeared that there was an access/permission issue.
Enabling Maintenance mode…
Updating Plugin Akismet (1/1)
Downloading update from http://downloads.wordpress.org/plugin/akismet.2.4.0.zip…
Unpacking the update…
Installing the latest version…
Removing the old version of the plugin…
Plugin upgrade failed.
An error occured while updating Akismet: Could not remove the old plugin..
After much googling I was still left scratching my head, although there were many forum posts on a similar subject they, for the most part, would go the same way:
- WP user complains of not being able to upgrade plugins
- Many other WP users chime in with similar issues
- A helpful soul says its not a problem just set every file and folder (and the kitchen sink) to have permissions of 777 (read, write and execute access for everybody and his passing dog)
- Then a very sensible WP user advises this is incredibly fool-hardy and insecure and you should never do this
- Finally the forum posts end without any real answer
I did temporarily set all folders to 777 to see if this would solve the problem and it had no effect for me what so ever. What did initially appear to be the issue was that my virtual server did not have FTP access as nearly all shared hosting has. But by following this very useful blog post from LornaJane I knew this was not the issue and completely agreed that I did not want to have an FTP server (another vulnerability) if I did not need to.
I was getting closer to my answer in the post and comments from LornaJane with the command to make the apache user be able write to the WordPress directory as follows:
chown -R apache:apache
But wait, as the my default Ubuntu server does not use the user/group apache but instead uses www-data the command I finally used via ssh on my remote server was:
chown -R www-data:www-data /var/www
And as if by magic my auto upgrades worked. Hopefully this may help someone else as well.