Adding the WordPress Multisite feature to an existing site

I’ve had this site as my main blog site for a number of years now, but I also keep another site for past projects that I’ve worked on. It’s been a static HTML site for a number of years and gone through a number of revisions, but I wanted to move it to WordPress to make it easier to edit changes directly on the site instead of the normal editing HTML and FTP’ing to the site workflow.

Since this site is already using WordPress, I thought I’d take a look at the Multisite feature to avoid having multiple installs on my Apache server. Turns out starting this late into the evening was probably not the best idea, but after a few hours I finally got it all fixed up. Here’s some key resources:

Key things that I learnt:

  • If you have an existing site, saw www.example.com and you follow all the steps in the above articles, using the subdomain approach you’ll end up with your existing domain as example.com and other sites as subdomain1.example.com, subdomain2.example.com etc. Not wanting to break existing links to my existing site at www.example.com, you could either put in place Apache rewriting, or the  approach I took was to copy my previous posts across to a new subdomain mapped as the original URL, www.example.com
  • To set up the above:
    • export the existing posts using Tools/Export
    • Create a new site and map it to www.example.com
    • Import your exported data into the new site
    • You can now delete the original posts in the original site that’s now mapped to exmaple.com. If it makes sense, create new content for this top site.

Cool new features in WordPress 3.1

WordPress really is the bomb. It’s everything I’ve ever wanted for hosting my own blog, and yet the new features keep coming. I’m loving the admin bar that appears across the top of the page when you’re logged in – makes it so much easier to jump into Dashboard features.

While I’m at it, not 3.1 related, but the Android app for WordPress is awesome too, letting me submit draft posts back to my site which I can pick up later when I’m back at a keyboard. Brilliant.

Enabling chrooted sftp access for WordPress automatic upgrades

Create wordpress user specifically for the auto update and add the user to the www-data group:

  • sudo adduser wordpress
  • sudo adduser wordpress www-data

chgroup the wordpress dir to the www-data group:

  • sudo chgrp -R www-data /var/www/wordpress

Add the following to /etc/ssh/ssd_config to chroot the wordpress user to the wordpress directory:

Match User wordpress
ChrootDirectory /var/www/wordpress
AllowTCPForwarding no
X11Forwarding no
ForceCommand /usr/lib/openssh/sftp-server

Restart the sshd service:

sudo /etc/init.d/ssh restart

Setup the sftp userid and password in the wordpress settings and select sftp.