<?php echo "Hello Again, World!"; ?>
Note: If upgrading to VMB 2.5 from a previous version, please read the upgrade instructions.
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.)
User “JZ” is selling written instructions for installing the system. (Please Note: I have not even seen his instructions, I’m just letting you all know.) More info in this comment.
…And if the directions are worth money to you, perhaps the actual software is worth something as well?
Download
Here’s what you’re really looking for: the download link. Have at it!
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.
719 Comments
Pages: « 1 … 26 27 28 29 30 31 32 33 34 35 [36] Show All
Hi. After long time of use I am a bit stack with the gallery plugin mudslideshow. Seems to work fine (options and config) with the exception of the editor button to insert the shortcodes that returns a “can’t connect to database”.
Track it down to some fork of tinymce php (mce_mudslide.php) that starts with:
<!DOCTYPE html PUBLIC….
the config.php full path load obviously should not be used by the developer but I am not sure if there is an easy fix or if someone can suggest an alternative recommendable gallery plugin with support for Picasa that works with VMB.
As usual many thanks.
Ummm… previous message removed the code… I’ll try again:
Mentioned PHP script starts with:
$wpconfig = realpath(“../../../../wp-config.php”);
if (!file_exists($wpconfig)) {
echo “Could not found wp-config.php. Error in path :\n\n”.$wpconfig ;
die;
}// stop when wp-config is not there
require_once($wpconfig);
// check for rights
if(!current_user_can(‘edit_posts’)) die;
global $wpdb;
//The nonce value
$nonce = wp_create_nonce(‘mudslide’);
Anyone tried the Quick Cache plugin with virtual multiblog? It is said not to rely on .htaccess.
I am using the T3 Total Cache, and it works fine for me… You will need to run with the same settings for all blogs, but that is not a problem for me. Also you need to manually modify a bit of code in the T3 Total Cache plugin to enable multisite mode… Check this post: http://tech.barszcz.info/2010/08/30/wp-hive-w3-total-ca...
Dunno the Quick Cache plugin, sorry…
Oops… forgot to mention… get your .htaccess settings right and write-protect the file… otherwise you’ll go crazy
Does this work with HyperDB? We have implemented HyperDB to split database read/writes and spread reads over multiple databases. Does Virtual Multiblog play nice with HyperDB?
I’ve never tried HyperDB, but I don’t know of any reason that it wouldn’t work. At its core, all Virtual Multiblog does is swap out different copies of wp-config.php. It’s highly unusual to find plugins that don’t work well with VMB.
Jose — definitely a coding error in the other plugin. Hard coding relative plugin paths as that code does is unambiguously considered bad practice in WordPress plugins. (“../../../../” — yuck!) WordPress has had the ability to move the wp-content folder for well over a year, and this code breaks that. It’s up to the author of that plugin to get his code up to WordPress standards.
Unfortunately I can’t recommend another gallery plugin. Sorry. I don’t use them.
I have used multiblog to run several websites now i need to take one website out of the multiblog and run it from another server due to IP issues.
How to do i move one website from multiblog install.The database for that is installed seperately
ARUL _ I think there is info about this in the comments but restore the original WP distribution config.php on the root. Incorporate there the values of your autoconfig and sitecconfig from multiblog there and it should be working.
Chris – I use quick cache plugin on various sites but normally point the cache dir to different paths on each site.
Hi Stephen,
Wondering if you might know a solution to resolve an error we’ve just started receiving after adding a plugin called Wishlist-Member.
This is the error “Fatal error: Call to a member function get_bloginfo() on a non-object in /wp-content/multiblog/resources/vmb-core.php on line 376″
Thanks for any suggestions.
I was using an older version of VMB, and I upgraded today as indicated in the instructions, but when I visit the two blogs I’d previously set up with VMB, they want me to go through the WordPress install again. It’s just asking for the basic site info, admin account, and email, but I’m afraid if I create the account, VMB won’t be able to see the existing tables that are in the database I use for these two blogs.
Anyone have any advice? I can easily make all this info the same, but I don’t know if there’ll be a follow-up screen that errors out if I try to put the existing database/table info in there.
I just upgraded VMB to the latest version as per the instructions, but when I visited the sites where I have my blogs installed, the WP install came up.
I’m afraid of going through the install again, even though so far it’s only asking for admin account information, the site title and an email address, because if there’s a subsequent screen that doesn’t want me to input the existing database information (i.e. it errors out), then I won’t know how to “reconnect” the VMB installs to their tables in my database.
Any advice?
I had some issues “forcing” plugins to all VMB instances.
Perhaps due to the fact that out multiblog config is moved to /multiblog.
Solved it by modifying the required /mu-plugins/vmb-plugins-bootstrap.php for this feature:
if( defined( ‘VMB_DIR’ ) )
//from
//include( VMB_DIR . ‘/resources/vmb-plugins.php’ );
//to
include( ABSPATH . VMB_DIR . ‘/resources/vmb-plugins.php’ );
With this fix so far seems to be working fine with WP 3.2.1
Jose Luis – Thanks for your comment on Quick Cache. How do you point the cache directory to different paths on each site? I assume you have one plugin directory for all sites (plugin updates would be tedious otherwise)?
Hi Chris. We only have security plugings forced on all sites so can’t help. With other plugins that use cache we share a cachedir but normally cache file name or extensions varies including the URL and/or is in each options database, s no conflicts.
In any case I understand VMB has some constant variables that include site name or user, I imagine you should be able to conf the cache to something like “cachedir/”.VMB_USER but I have not tried it myself.
Having an issue with WPSeo plugin (actually seems to affecta various others) when setting different constant for plugins directory on the blog conf:
The plugin (I understand correctly) uses:
define( ‘WPSEO_URL’, plugin_dir_url(__FILE__) );
to define a base constant to access his files (css, JS, etc)
Defining different WP_CONTENT_DIR works fine:
$vmb_const['WP_CONTENT_DIR'] = ABSPATH .’myblog’;
But as soon as I define different path/URL for plugins:
$vmb_const['WP_PLUGIN_DIR'] = ABSPATH .’wp-content-mysite/plugins’;
$vmb_const['WP_PLUGIN_URL'] = “http://”. $_SERVER["HTTP_HOST"] . ‘/wp-content-mysite/plugins’;
The value of “plugin_dir_url” turns from:
http://mysite.com/wp-content/plugins/wpseo-yoast/
to
http://mysite/wp-content-mysite/plugins/home/webs/wordp...
this is… adds fullpath to what should be the new plugin URL !!!!
No idea if this hast to with somekind of bug of WP or something not correct when defining the constant at VMB, but I am now stack with it.
Hi
This plugin really changed my life.
I guess if someone never did a php script to make useful summary of the installed blogs, now I’m trying to get “installed plugins” but I can’t find a plugins lister script that works in a page template.
Anyone tried VMB with WP 3.3 RC1?
Pages: « 1 … 26 27 28 29 30 31 32 33 34 35 [36] Show All