<?php echo "Hello Again, World!"; ?>
Announcement: Virtual Multiblog is now on GitHub.
Greetings and salutations.
This is my second blog, which is here to serve as a repository for the really die-hard geekery that I feel just doesn’t belong in my regular blog. When I realized the need for a second blog, installing it ended up being a longer process than i anticipated, and I thought I would share the fruits of my experience.
Let me step back for a moment. I am a true hacker at heart, in the traditional sense: I love to pull things apart and take a look. To see how they work and how they might work better. I’m also an avid Mac-head, and since the rise of OS X, I’ve been learning the ins and outs of its Unix-like underbelly.
In a nutshell, my computer is highly customized.
A few years back I got a second computer — a laptop — and quickly discovered that while keeping one computer tweaked to prime operation just the way I like it is kind of fun, trying to keep two computers in such a state, and relatively synchronized, is a frustrating exercise in futility.
I also know a good bit of web coding. As I’ve been working with WordPress for a couple years now, I’ve come across a number of good plugins and expansions along the way. Beyond issues involved with installing them, (which is admittedly pretty easy, usually) over time I have to keep up with updates to these — not to mention updates to WordPress itself. From time to time I even delve into the plugin files myself and make improvements….
And I want to put in a second blog? Am I nuts??? Thinking of what a pain it would be to maintain two copies of WordPress, I started looking into the various multi-blog solutions people have come up with. Most of them involve a lot of weird modifications to several files and basically comprise major modifications to large swaths of the WordPress code that are fundamentally incompatible with the regular version.
I am a great fan of what I consider “elegant” coding, which means that the designer does his job with the simplest and most straightforward methodology possible. And I found a very elegant solution to the “multiple blog on one install” question. Allan Mertner came up with something that blew me away with its simplicity and power.
WordPress holds all of its data in a MySQL database, and there is a single file called wp-config.php that holds the database login information. Allan looked at this and realized that if you can change that one file, you can completely replace the blog. With this key realization he came up with a cunningly straightforward multi-blog system:
- Replace the standard wp-config.php file with a new version that calls a different configuration set depending on what directory it’s in.
- Set up symbolic links that serve as “virtual directories” that all point to the WordPress directory.
Using the example of this site, I have an install of WordPress in the root web directory, and a symbolic link called “nerdaphernalia” (that’s right, you’re soaking in it!) that points back to the root. The modified wp-config file points to either the default or nerdaphernalia config file, depending on which of those two directories it thinks it’s in.
So other than a happy user, where do I come in in all this? Well, I made a number of improvements. First, Allan’s system was great, but it required us to install various files in and around the core WordPress files, which for me at least defeats part of the purpose of using a multiblog system in the first place. I’m trying to make updates easier, remember? Updating WordPress generally involves deleting everything but the wp-config.php file and the wp-content folder, and then dropping in the new versions of everything else; but if there are important but non-standard files strewn about, I can’t just do that. I have to remember to go through and preserve those files, and then replace them when they’re done. Add in a few plugins that work the same way, and we have a real hassle.
So first off, I tucked all the files, except for the one modified wp-config.php, into a folder in a safe place. Next, I greatly streamlined the install process. At a minimum, the user only need edit a single configuration file, autoconfig.php
. If desired, the various blogs can each have individual config files, but it’s no longer necessary.
I’ve added user-accessible functions (and the really handy VUSER constant) that can be used in themes and plugins. I’ve added the ability to customize the location of the configuration files, so the security-conscious can move them entirely out of the Web directories if they wish. Overall, we are left with a easy but powerful system for running virtually any number of blogs off a single install of WordPress.
Install instructions are included with the download. Still have questions? Check out the readme and the FAQ. (Note: Sometimes the readme will list a higher version than the download. That happens if I have a development version installed.)
Download
Here’s what you’re really looking for: the download link.
For the truly latest and greatest, I suggest you go get it from GitHub.
Here is a local link, which probably has an older (but possibly more stable) version:
Virtual Multiblog v2.6.2
Is this download worth something to you? If you have found this site useful, please consider making a donation. Even as little as a dollar is appreciated:
History/ Acknowledgements
For a detailed history, please see the readme file in the download.
Many of the improvements to version 2 were based upon or inspired by commenters to my blog. To them, and to everyone who has sent comments, I am grateful.
Good luck. Have fun.
My main concerns was that I setup VMB similar to the advice in this post as I wanted to plan ahead for when I add language support to my site.
My concern is now upgrading to the latest core of WP without breaking my custom theme. Any resources you would recommend to test before upgrading?
In terms of testing, I always suggest a local test server that reasonably imitates the live server. Recently I’ve been looking at Vagrant, which is a VERY easy to use system for setting up virtual test servers on your computer. Check it out: https://www.vagrantup.com/
Pingback: 101 List Of Awesome WordPress Tips and Resources | E Tips Blog
Pingback: How can I fix a Virtual Multiblog install that has no errors, but won't show all my sites? - WordpressHub
Looks interesting. I need to have multiple blogs on my wp setup and this will definitely be useful.
Can I partecipate with a few functions I wrote myself using this software ?
By all means! Let’s see what you’ve done. π
Going for holidays now but I’ll answer in August, promised π
Can I send you a private mail ? where ?
There’s an email form at: http://striderweb.com/feedback/
goooooooooooood
Pepe the Frog owns this post π
Seriously, we revamped Virtual Multiblog code creating a package.
Is someone interested? Please write me in case, it will be open source and striderweb/nerdaphernalia is clearly in credits.
Itβs on Github. Go ahead and fork it!
Even I wanted to have multiple blogs for my company My Holiday Happiness ..This article really helped me…
I was impressed to see. This is a very useful article for me. Such information blogs are daily for me but I stuck to your blog.
Nice Informative post
Thanks for sharing
Yashoda Cancer Institute is one of the Best hospital for Cancer Treatment in Delhi NCR. Our motto is to serve every person with the best of healthcare facilities.
It is a great website. The design looks very good. I will bookmark this page. I enjoyed the information.
Thanks for sharing this interesting and informative
This is amazing. I really enjoyed your content. Good job and keep it up.
Nice Post Thanks for sharing, I love WordPress
Our complete regtech solution solves Distributor Oversight faced by Australian Product Issuers and Distributors under RG274βs Design and Distribution Obligations (DDO).