FAQ — Virtual Multiblog

This page should hopefully help out with the most common questions people have. I will be adding to this page as time goes on. If you don’t find answers here or in the readme, please feel free to ask questions. :)

Q: Are my plugins compatible with Virtual Multiblog?

A: Almost all plugins are completely compatible with this system. The only known exceptions are plugins that alter the .htaccess file; this mostly comprises caching plugins such as WP Super Cache.

Q: Why are all of the blog addresses showing the same blog?

A: Most likely, the system can’t figure out the VUSER for some reason. When that happens, it uses the autoconfig info, or if you’ve set up a $vusers[] list, the first entry on that list. To confirm that it’s just defaulting to the first thing on $vusers[], move something else to the top of the list.

Similar problems can be caused if a config file has an incorrect name, so check that as well.

Q: Okay, I’ve made a folder for a second blog. Now what do I put in it?

A: Nothing. In fact, get rid of the folder. If you want a “virtual” blog in a subdirectory, that subdirectory isn’t going to actually be a folder, it’s going to be a symbolic link. (See more on Symbolic Links.)

If you’re making a virtual blog in a subdomain (e.g. newblog.example.com ) you don’t even need the symlink. Simply point the subdomain to the same location as your primary domain.

The whole point of this exercise is that all your blogs will run off a single set of WordPress files. You should never have to have multiple copies of the files in different places.

Q: Does Virtual Multiblog work with WordPress version x.x?

A: As of this writing, Virtual Multiblog 2.6 has been tested through WordPress 2.8. Because of the nature of the VMB system, I do not anticipate basic functionality breaking in future versions, unless WordPress radically changes the way it works.

Although people tend to refer to VMB as a “plugin” for WordPress, it really isn’t: Virtual Multiblog doesn’t run on top of WordPress, WordPress runs on top of Virtual Multiblog! (This is why I consistently refer to it as a “system” rather than a “plugin”.) Because of this, there is very little in the basic function that depends on how WordPress works. That makes it pretty future proof.

It does have some “plugin-like” functions that are more dependent on WordPress, and thus may change or break over time. At this time that code adds no major functionality beyond a diagnostic page in Admin.

Q: The new version is missing the plugin folder. What happened? Do I still need it?

A: Sorry, that’s two questions. The plugin is no longer needed as of VMB version 2.4. Before upgrading, you should deactivate the “Virtual Multiblog Support” plugin in all blogs. The easiest way to do that is to delete the file. The functions formerly handled by the plugin are still there; I just got rid of the plugin, which was acting as a bootstrap.

Q: Can the blogs have different themes and plugins?

A: Yes. Each blog runs as a completely separate install of WordPress. As such, they have separate Admin sections, separate Users, and separate settings (including which themes or plugins are active).

A: A symbolic link, or “symlink” is a type of shortcut originating in Unix-like operating systems. Basically, it is a second representation of a particular file (or in this case, directory). A symbolic link basically acts as though it is the target file or folder. In the case of this system, you can put WordPress files in one folder and make a symlink pointing to that first folder. The symlink acts as a second folder that has all the contents of the original.

As for making them, that’s a huge topic, and too big for this page. It totally depends on your system, your OS, settings within your OS, and so forth, though I can say that they can be made in Unix or Linux; I have personally made them in Mac OS X (using Cocktail); and I am informed by commenters that you can make them in Windows.

If you don’t know much about them, it might be best to ask your hosting company to make them for you. That’s what I do. :)

For further information, you might find the page at Wikipedia useful.

Q: I’ve redirected different domains to my site, and set up the config files, but the domains all show the same blog. What’s going wrong?

A: It could be many things. First off, a URL redirect will not work; the domains must all point directly to the server (or name server). Next, the server must have those domains pointing to the same directory with the install of WordPress. (In Apache the server admin would most likely set up “Virtual Hosts” that all point to the same place.)

A bit of info that might help with troubleshooting: if the system can’t figure out what VUSER to use, it will try to use the default. (If you’ve set up the $vusers[] list, the default is the first on the list.) Thus, problems determining VUSER can result in different virtual blogs displaying the same content.

Q: How do I upgrade to a new version?

Step 1: Set your configuration files aside.

Step 2: Delete the existing /wp-content/multiblog/ folder. Replace it with the new copy. Put your existing config files back into the /config/ folder.

Step 3: In the root WordPress folder, replace the old wp-config.php with the new one.

Step 4: If you have the multiblog-support plugin installed in your plugins folder, delete it. You don’t need it anymore.

NOTE: If you previously had to do strange things to your $vusers[] or table-prefixes relating to double-slashes, I think that’s fixed as of in 2.2. So if you’re having trouble, you may try undoing whatever you had to tweak in the old version. (I was never able to reproduce that error, so I don’t know what exactly caused it, but I’m hearing that it’s fixed now.)

Q: Is there a way to make it so that when you log on to one blog you’re logged on to them all?

A: Not at present. Somewhere down the line I would like to implement this, but I don’t expect it any time soon.

76 Comments

Pages: « 1 2 3 [4] Show All

  1. Irving Washington
    #61 | Posted July 20, 2009 at 7:52 pm

    Hey, thanks for the response – I’ve vaguely worked it out, and realised I did my domain obfuscation poorly as well.

    1. Part of the problem was the dual “server” parts (one rewrite, one with rest of details) for each domain – and the alphabetically second domain (my “a.org”) was over riding the b.org server rewrite config. This was discovered through testing.

    2. By removing the re-write part of the conf’s and merely adding the extra domain to the server_name line in the main part of the configuration seems to have solved the problem.

    ie: server_name http://www.a.org a.org; (in a.org conf)
    and: server_name http://www.b.org b.org; (in b.org conf)

    3. Having said that (“solved”), I am still not sure about my nginx skills, and neither blog has been tested or populated with real data as yet, so there may be further issues down the track. I will address those when they appear :)

  2. Lee
    #62 | Posted July 25, 2009 at 1:53 pm

    Stephen:

    Thanks for the great code; it’s made my life much easier for the past couple of years.

    I recently updated both WordPress and VMB, and now all three blog addresses direct to the same blog. I’ve updated the code in mb-autoconfig.php, created separate mb-config.php files for each of the blogs, each of which contains a table prefix reference to the auto-generated value. (I’m just guessing the value is auto-generated, because I don’t recall setting that up myself.)

    The result is still the same: All addresses direct to the blog that is listed first in the mb-users.php file.

    Your FAQ answer seems to address this problem, but it doesn’t give a solution. Can you point me in the right direction? Thanks very much!

    Here’s my setup: I have three subdomains (home, blog, and diaries), each of which is for a separate blog. WordPress is installed in a WordPress folder on the root.

    ——————————–
    Here’s my mb-autoconfig.php file:

    <?php
    if ( ! defined( 'ABSPATH' ) ) exit(); // sanity check

    // ** MySQL settings ** //

    $vmb_const['DB_NAME'] = '’; // The name of the database

    $vmb_const['DB_USER'] = ”; // Your MySQL username

    $vmb_const['DB_PASSWORD'] = ”; // …and password

    $vmb_const['DB_HOST'] = ”; // 99% chance you won’t need to change this value

    $vmb_const['DB_CHARSET'] = ‘utf8′;

    $vmb_const['DB_COLLATE'] = ”;

    $vmb_const['AUTH_KEY'] = ”;

    $vmb_const['SECURE_AUTH_KEY'] = ”;

    $vmb_const['LOGGED_IN_KEY'] = ”;

    $vmb_const['NONCE_KEY'] = ”;

    ?>
    ————————————

    Here’s my mb-users.php file:

    <?php
    if ( !defined('ABSPATH') ) exit(); // sanity check

    $mydomain = '.net’;
    $vusers[] = ‘home’;
    $vusers[] = ‘blog’;
    $vusers[] = ‘diaries’;

    ?>

    ———————————

    Finally, here’s my mb-config-home__net.php file:

    <?php
    if ( ! defined( 'ABSPATH' ) ) exit(); // sanity check

    $table_prefix = 'wp_home__net_’;

    ?>

  3. Andrew Blanda
    #63 | Posted September 4, 2009 at 8:58 pm

    Hi Stephen,

    I have been struggling to find a good, easy solution to running 2 blogs on one database, and am happy to have found VMB (based on the number of positive reviews out there on the web! :-)

    To start off, I have a main domain (mpl.com) and a second domain (ab.com). I have pointed the 2nd domain to mpl.com/wordpress (where WP is installed). Installed VMB following the Easy setup. When I get to step 7 & login through the 2nd domain (http://ab.com/wp-admin), it allows me to login in to the DB, but then reverts to the main blog (mpl.com) contents, plugins, posts, etc. The URL in the browser window now shows http://mpl.com/wordpress/wp-admin!

    In essence, I am hitting the same problem described in your FAQ question 2: (Why are all of the blog addresses showing the same blog?). So, I went back and followed step 2 of the Advanced setup (setting the $vusers):

    $vusers[] = ‘ab.com’;
    $vusers[] = ‘mpl.com’;

    (I put them in this order to test whether there was a fallback happening to ab.com, as per this Qn in your FAQ: I’ve redirected different domains to my site, and set up the config files, but the domains all show the same blog. What’s going wrong?)

    All I seem to have now, is a domain redirect that replaces ab.com with mpl.com. I don’t believe I have URL redirect; in my hosting provider’s control panel I have set the ab.com under the domain pointing option (is that a URL redirect?)

    Let me know if you need other info!

    Thanks,
    Andrew

  4. #64 | Posted September 8, 2009 at 4:24 pm

    Andrew –

    “in my hosting provider’s control panel I have set the ab.com under the domain pointing option (is that a URL redirect?)”

    It certainly might be a redirect. Best to ask them. Pointing two domains to the same directory on a server, without a redirect, is sort of unusual, so you should ask them what it’s doing.

  5. #65 | Posted September 10, 2009 at 9:15 pm

    If it is a redirect, you might try setting

    define( 'VMB_ACCEPT_REDIRECTS', true );

    in wp-config.php

  6. #66 | Posted December 2, 2009 at 6:44 pm

    I want to combine two separate, already existing, blogs using multiblog. Is it possible and what should I do? I tried the most obvious approach – set separate config files using the info from the existing blogs. Any Ideas?

  7. #67 | Posted December 9, 2009 at 9:17 am

    In short, yes: create a config file for each and set the table prefixes to whatever they are for the existing blogs. Then it should pull the existing data from the database and give you the same blogs.

  8. Nerml
    #68 | Posted December 10, 2009 at 11:19 pm

    Perfect. Bog simple to get going, and works a treat.

  9. #69 | Posted December 11, 2009 at 8:05 am

    In order to give my multiple blogs each need their own uploads folder and theme folder, I gave the individual config files this line:

    $vmb_const['WP_CONTENT_DIR'] = ‘/home/user/content/blogname’;

    In that directory, I placed a themes and uploads folder and a symlink to the multiblog plugins folder (since I don’t want each blog to have its own plugins, just its own themes and uploads).

    The virtual blog I tried this one works without error, but it seems to ignore the config setting and just use the main installation wp-content folder instead.

    What am I doing wrong? Is there a better way to achieve my goals?

  10. #70 | Posted December 11, 2009 at 8:20 am

    Doh, I figured it out already. I named the config file “mb-config-subdomain.domain.com.php” instead of “mb-config-subdomain_domain_com.php”

    So, now it’s using the right directory, however, there is still a problem:

    Now if I choose a theme in my custom directory, it loads the files, but anything on the html side is pointing at subdomain.domain.com/wp-content/themes/themename/xxx which doesn’t work, that directory doesn’t exist.

    I’m pretty sure this issue will be the same for the uploads directory.

    The only thing I can think of would be to use the main themes directory but clone the themes (the problem is that I often use the same theme but tweak the code per blog. I don’t want tweaks carrying over to other blogs most of the time). So instead of holding different versions of “kubric” in different theme folders I’d have “kubric-blogname”, and “kubric-blogname2″ in the main theme folder.

    For uploads, I guess I could set each blog to upload to wp-content/uploads/blogname in the settings per blog?

  11. #71 | Posted December 11, 2009 at 10:30 am

    Pete — Other WP constants to be aware of:

    WP_CONTENT_URL
    WP_PLUGIN_DIR
    WP_PLUGIN_URL

    The uploads directory can be set within the WP Admin interface.

  12. #72 | Posted January 30, 2010 at 12:43 am

    I have been using version 2.5 (on WP 2.9.1) for a long time. I have three blogs on the same install. However, I want to separate the blogs and set up two on independent installs and the third I want to import into a hosted version of WPMU. I assume that that will require backing up portions of the DB but I don’t know how. Is there a simple utility to extract the database for a particular domain or subdomain?

  13. #73 | Posted January 30, 2010 at 12:17 pm

    If your server has PHPMyAdmin on it, use that. I use a free Mac program called Sequel Pro.

    Another approach may be to simply copy the entire database, and then delete the tables you don’t need from each one.

  14. #74 | Posted April 14, 2010 at 3:30 pm

    Does anyone know of a plugin that works with vmb for a sitemap?

  15. #75 | Posted April 15, 2010 at 12:14 am

    M Callans,
    What I do is use the normal google sitemap xml plugin everyone uses and then define an exact location for my sitemaps.

    I upload a blank sitemap.xml and .xml.gz. Then I rename it if my site is myexamplesite.com to sitemap-mes.xml and xml.gz with my FTP program.

    THen in the plugin I set it to use that same -mes.xml file. I set all of them like that.

  16. #76 | Posted April 16, 2010 at 9:52 am

    Thanks Mike for the google sitemap work around — I will try this.

    On another note, I had a need to create a robots.txt, info.txt for a specific domain on the server. I eventually found the kb_robots plugin and modified it so that it would work for me in IIS. I then modified it to do the same thing for info.txt. It works, but I wonder if there is a more eloquent solution since this requires every page request to be evaluated.

Pages: « 1 2 3 [4] Show All

Post a Comment

Your email is never shared.

Subscribe without commenting