WordPress 2 multi-blogging made easy


I upgraded the site to WordPress 2 this morning. This wouldn’t be a bit deal, since the dev team has made it so easy to upgrade. What makes it interesting is that I read a tip on the WordPress forums and came up with a simple method to enable multiple domains using one blog installation on Linux/BSD systems. 1) Get WordPress 2.0 and unpack it to a master directory you’ll be symlinking later. 2) Copy wp-config.php to wp-config-orig.php. 3) edit wp-config.php, replacing the whole thing with: <?php include($_SERVER['DOCUMENT_ROOT'] . '/config.php'); ?> 4) make the directory for your domain, for example: mkdir coderseye.com 5) cd into the directory and symlink the contents of your master directory. cd coderseye.com ln -s /home/example/wordpress-master/* . 6) copy the original wordpress config file, naming it “config.php” and edit like you usually would for wp-config. cp /home/example/wordpress-master/wp-config-orig.php config.php 7) Done! You’ve successfully linked another directory as a separate blog with the same base files.

Making it automatic

I’ve made a script which automates all of this, at least on Linux boxes. You just call it like so: setup_multiblog.sh master slave If “slave” directory exists, it will be backed up, and upgraded to work with the master as a slave-multi-blog. If it doesn’t exist, it will be upgraded. If the master doesn’t have the modifications I describe in step #3, the script will back up wp-config and make the modifications. setup_multiblog.zip Enjoy, let me know if it needs tweaks, it has a lot of self-checks built in, so hopefully it won’t trash anything. I’d backup first, just to be double-sure.