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.

90 Responses to FAQ — Virtual Multiblog

  1. Pete Michaud says:

    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?

  2. Ray says:

    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?

    • Stephen R says:

      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.

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

  4. Mike says:

    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.

    • Hilmy says:

      Newer versions of Google XML Sitemap plugin no longer has “custom location” feature available.

      Is there a work around this or any other plugins that do similar job?

  5. 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.

  6. Markus says:

    Hi, I am trying to set up a multiblog with wp 3.0.5. While the basic things work – two blogs, different posts etc., setting $vmb_const[‘WP_CONTENT_DIR’] results in a functional admin page, where I can upload images that go into the correct directory, but the content page is returned completely empty – untill I comment out that $vmb_const[‘WP_CONTENT_DIR’] setting in my my-config-wp2_local.php

    Any idea what could be the reason?

  7. Markus says:

    Stephen, I did indeed set both variables, and when writing a new post it works as intended – the html code that gets expanded from the image upload looks correct.

    The problem comes up when trying to view the post: As long as the setting of both WP_CONTENT_DIR and WP_CONTENT_URL are active, i.e. not commented out in my-config-wp2_local.php, accessing the url of the page returns only an empty page of 20B size, yet no html or anything visible inside.
    When I comment out the setting of those variables in my-config-wp2_local.php, the post gets displayed as intended. Unfortunately there is no error displayed in the Apache error log.

    Virtual Multiblog Diagnostics
    Version………………. 2.6.2
    VUSER………………… wp2.local
    “Clean” VUSER…………. wp2_local
    VMB_DIR………………. /www/vhosts/wp1/wordpress/wp-content/multiblog
    VMB_URL………………. http://wp2.local/wordpress/wp-content/multiblog
    Config File…………… mb-config-wp2_local.php
    WordPress version……… 3.0.5
    ABSPATH………………. /www/vhosts/wp1/wordpress/
    WP_SITEURL……………..–
    WP_HOME………………..–
    PHP version…………… 5.3.2-1ubuntu4.7
    MySQL version…………. 5.1.41-3ubuntu12.9
    $_SERVER[‘SERVER_NAME’]… wp2.local
    $_SERVER[‘PHP_SELF’]…… /wordpress/wp-admin/index.php
    $_SERVER[‘HTTP_HOST’]….. wp2.local
    $_SERVER[‘SCRIPT_NAME’]… /wordpress/wp-admin/index.php
    $_SERVER[‘DOCUMENT_ROOT’]. /www/vhosts/wp1
    End Diagnostics

    Does this show any anomalities?

  8. Al Virani says:

    Hi Stephen,
    I’ve instaleled VMB as per your instructions. The config folder is on the site root. Unfortunetly I’m getting an “Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.”
    “The webpage at http://wealthandsuccess.org/wp-admin/install.php has resulted in too many redirects.”

    By using an echo string (eg. “echo ‘Hello filename.php’;”) in each file along the way, I have traced that the code does work from index.php=>blog/wp-config.php=>mb-autoconfig.php=>mb-users.php=>html/config/mb-config-wealthandsuccess_org=>blog/wp-includes/pluggable.php. The trace stops there with “Warning: Cannot modify header information – headers already sent by (output started at /home/content/f/o/r/forcomcanada/html/blog/wp-includes/pluggable.php:1775) in /home/content/f/o/r/forcomcanada/html/blog/wp-includes/pluggable.php on line 897”

    I have tried many options and nothing works. Do you have any insight on this that might be able to share with me so I can work this out? I’d appreciate it if you could help me. I’m going crazy and am at a complete loss now. Thanks.

  9. Al Virani says:

    UPDATE: line 897 in pluggable.php is a 302 header redirect part of the the function wp_redirect.php. I should also point out that the blog works fine when I use the original WordPress wp-config.php, but the above issue happens only when VMB is enabled with the VMB wp-config.php file. (wp-config.php File is in the root, but WP install is in /blog. I have added the correct path info as per your instructions). Thanks.

    • Stephen R says:

      As you may have guessed, the “headers already sent” error is caused by the “Hello filename” string you’re echoing. PHP throws that error if you try to set headers when something has already been sent to the browser — headers have to be first. So by the time pluggable.php tries to set headers you’ve already sent the “Hello” and it bugs out.

      Beyond that I’m not sure what might be causing the redirect problem, other than something wrong with the config file.

  10. Al Virani says:

    Well, yes, the echo string is only for troubleshooting to see which page is the one that it stops/bugs at. The header error then tells me what is the next file in the chain. After that, I put the echo string in the next file to troubleshoot & so on.

    However the ?Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects. The webpage at http://wealthandsuccess.org/wp-admin/install.php has resulted in too many redirects.? error only occurs through the use of the VMB version of wp-config.php. When I replace it with the original wordpress wp-config.php file, my blog works fine (abeit not a multi-site blog). When I put the VMB file back, the error occurs again.

    The only line I have changed in the wp-config.php is the following:
    //define( ‘VMB_CONFIG_DIR’, ‘../../../config/’ ); //=>Not Working
    //define( ‘VMB_CONFIG_DIR’, ‘/home/content/f/o/r/forcomcanada/html/config/’ ); //=>Works.
    define( ‘VMB_CONFIG_DIR’, ‘config’ ); //=>Works.

    My structure is:
    Root
    |_index.php (=>contains require(‘./blog/wp-blog-header.php’);)
    |_config (VMB config folder)
    |_blog
    |_wp-content
    |_multiblog

    Thanks.

  11. Al Virani says:

    Sorry, the spaces were removed when I posted. Structure=:
    Root
    ..|_index.php (=>contains require(?./blog/wp-blog-header.php?);)
    ..|_config (VMB config folder/directory)
    ..|_blog
    ….|_wp-content
    ……|_multiblog
    Thanks.

  12. mark mayerly says:

    Is it possible to domain map the virtual blogs as well as assign specific IP:s to specific blogs?

    • Stephen R says:

      Blogs can be on different domains if the different domains all point to the same directory on your server.

      I don’t know about mapping different IP addresses, but I think if they’re all pointing to that same directory, it should work.

  13. Healme says:

    Hi,
    I’ve a VMB user for many years now. There are times when I need to convert stand alone blog into multi blog and vice versa. The challenge is WP doesn’t recognize the original mySql and it initiate a new WP install which create a new database and I don’t want that!

    Anyone knows how to work around this so I can keep the old database reused. What changes did VMB incurred into the DB? I’ve tried several things but yet to crack the code 🙂

    • Stephen R says:

      You may have to change some $vmb_const[] declarations to CONSTANTs. Other than that VMB uses the same types of wp-config settings as regular WP. The database isn’t different at all.

      Especially make sure you’re setting the proper table_prefix.

  14. Stephen R says:

    ANNOUNCEMENT: I am closing comments on this FAQ page for Virtual Multiblog. Existing comments will remain, but the form for new comments is going away. You can still make new comments on the main Virtual Multiblog page, or submit issues on the new project page at GitHub.

    http://striderweb.com/nerdaphernalia/features/virtual-m...
    http://github.com/strider72/multiblog

Comments are closed.