Virtual Multiblog for WordPress

<?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:

  1. Replace the standard wp-config.php file with a new version that calls a different configuration set depending on what directory it’s in.
  2. 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!

Virtual Multiblog v2.6.2

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.

684 Comments

Pages: « 125 26 27 28 29 30 [31] 32 33 34 35 » Show All

  1. #601 | Posted October 21, 2009 at 5:00 pm

    Hi Stephen,
    Multiblog is excellent and I like it a lot. When I can afford it I look forward to making a donation in remuneration for the wonderful work you’ve done.
    I would like to suggest a small change. In an effort to improve the security of my wordpress sites I’ve changed the table prefix from the commonly used “wp_”. However, when I change $table_prefix in the mb-autoconfig.php file, I lose the ability to have multiple databases. I would therefore like to suggest a master variable for $table_prefix which acts slightly differently to $table_prefix. When set, it is used to apply a different default $table_prefix (other than ‘wp_’) to all “user” defined table prefixes.
    Please see unified diff below. Please feel free to change anything to your satisfaction.

    ==== ==== ==== ====
    [root@fooweb src]# diff multiblog-v2.6.2/resources/vmb-init.php multiblog.patched/resources/vmb-init.php
    5a6,10
    > /* HISTORY
    > ** v0.0.1-20091020-SJP: a master virtual multi blog table
    > ** prefix used with auto multi blog table names
    > */
    >
    32a38,41
    > // * v0.0.1: a master virtual multiblog table prefix
    > if( empty( $vmb_table_prefix ) )
    > $vmb_table_prefix = ‘wp_’;
    >
    34c43
    $table_prefix = $vmb_table_prefix . get_virtual_user( true ) . ‘_’;
    47c56

    \ No newline at end of file

    > ?>
    ==== ==== ==== ====

    $vmb_table_prefix is than defined in mb-autoconfig.php.

    I hope you like the suggestion.
    Thanks
    Stephen P.

  2. #602 | Posted October 25, 2009 at 6:40 am

    The script is awesome works like a charm and it took me just 1 hours to install and run neraly 7 domains. Now installing another blog is just editing couple of files away.

    The flexibility of this is amazing and You can add what ever you like.Only problem might be in security accept if you do have all the domains use on DB.So go for multiple databases and vusers which should take you only 30 minutes more for 10 domains because most of the work involves repetitive work and nothing more. please make this project grow and I am supporting it as much as I can.

    Thank You

  3. Jason W.
    #603 | Posted November 4, 2009 at 10:16 am

    Any thoughts/comments would be VERY much appreciated.

    May be willing to hire someone to help us with this.

    Here’s the deal:

    With 601 comments here, I’ve been browsing through – trying to see if someone has asked this or there is a written solution. Not able to find anything. Would really appreciate any info Stephen or anyone can provide me here.

    The Situation:

    I’m getting ready to launch 1,500 wordpress blogs. All painfully written by hand – I’m not using any of the automated blogging junk. Those 1,500 will turn into over 4,000 in late 2010.

    I need a solution that can do the following:

    1. The ability to manage 1,500 to 4,000+ blogs in a single admin area.

    2. The ability to easily add new blogs.

    3. The ability to easily have WP install on the new domain, create the database, etc. (Note: With this many blogs, am I correct by thinking that having ALL these blogs share the same database would not make sense to do?)

    4. The ability to have all the plug-ins I’m using on all the other sites to be added to the new domain.

    ** Note: Maybe somehow have a “CORE” blog that I don’t have any content on, but somehow all the other sites will mirror the plug-ins I install on the “CORE” blog? This way when I want to add a new plug-in, I don’t have to manually add it to 4,000 blogs. I’d kill myself. **

    5. To throw a wrench into the mix, I’ll have 10-20 blogs per server. I cannot have all these blogs running on one single server for many reasons.

    Some points to consider:

    1. It’s OK if I have to log into each blog separately when I want to add content if that makes things easier as far as getting this crazy mess set up.

    2. There will be 1-2 additional users who would have access to all of these blogs. Meaning, this would not be a typical WPMU install where one would have a user or admin for each blog.

    3. When WP launches a new release, I’d LOVE the ability to have a ‘one click upgrade’ feature that automatically upgrades all of the blogs. Upgrading all the blogs by hand would cause me to break out in hives for sure.

    4. Each blog will have it’s own domain name. i.e.: domain1.com domain2.com, domain3.com all the way to domain4000.com and beyond. I do not want to do this using subdomains, forwarding, masking, etc.

    5. Each blog will need it’s own Google Analytics – or some other analytics that could handle thousands of websites. I don’t know the limits on Google Analytics, so I’m fine with using more of a corporate solution that has more functionality anyway.

    Conclusion….

    I’m wondering if it would be best to fully map this out and hire a programmer to put all of this together??? Or does Stephen’s solution make this easy for a 1 to 2 man shop to put in place??

    Thank you so much for your help and advise.

    - Jason

  4. dndco
    #604 | Posted November 4, 2009 at 11:19 am

    Jason,

    In short, you are in the right place. VMB will allow you to do everything you have outlined function wise accept switch between logins automagically. Although, you could probably find a developer and make that happen fairly easily. You can use one DB per VMB install or have individual DBs per blog. Personally, I would go with one and back it up remotely daily or weekly or depending on how often the content is updated.

    With 1500 blogs total @ 20 blogs per VMB install, you are looking an needing 75 VPSs. Typically, you cannot do a VMB in a shared hosting environment as you need access to Apache to update the DocumentRoot of 19 of the domains to point to the code base in the one ‘core’. So you are looking at some HEFTY server costs per month.

    In my experience, if you can find a VPS that uses Kloxo they are the easiest to set up a VMB as you can update the DocumentRoot per domain in the GUI. Cpanel technically does not support changing document root though there is a workaround but it has to be done via SSH. Last I checked Plesk supports it via using a vhost.conf that also needs to be done via SSH.

  5. Jason W.
    #605 | Posted November 4, 2009 at 2:25 pm

    Hi DNDCO,

    Thanks for replying back. Hmmmm…

    So I understand correctly, you’d go with one DB which would house 1,500 and at some point 5,000 blogs? Is there a limit to how many you can have?

    What I didn’t want to happen was to have something go wrong in the DB or the one server and have all sites down at once, which is one main reason why I wanted to diversify the blogs onto different servers.

    If I’m not easily able to do this in a shared hosting account, would it make sense to get a dedicated server – and maybe do 50-100 or so blogs per server?

    That then brings up the question… how do I keep my blogs hidden from the snoopers? Meaning, they can easily see where the site is hosted, then do a search to find other domains hosted on that server. With a shared server, there would be another 1,000 or so sites on there – and it would be impossible to figure out which sites are mine and which are not.

    That’s my biggest fear with using a dedicated server – unless there is a way to hide what sites you actually have on your server that I don’t know about???

    It’s great to know I’m in the right place. This was NOT easy to find a solution for – that’s for sure!

    I appreciate any further help you or any other readers can provide us here so we can finally pull the trigger.

    Thanks again,
    Jason

  6. dndco
    #606 | Posted November 4, 2009 at 2:48 pm

    No, I would go with on DB for each install of VMB. So per your definition, you were going to set up 20 blogs per server or per VMB. I would have the 20 blogs running in one DB.

    If that DB went down or got corrupted all 20 sites would be effected, yes.

    It’s not that you cannot do it easily on a shared hosting account, it is likely that you can’t do it at all. Shared hosts are not going to make the server side changes that are necessary to run a VMB.

    You don’t need a dedicated server, just a VPS with mulitple class C IPs or multiple VPSs, or multiple VPSs with multiple class C IPs. The one host they I know of that does this is Spry. However, they use Cpanel and as I stated earlier Cpanel requires a workaround.

    You could spread the sites or VMBs across IPs inside that VPS if you wanted. If you hide your whois info and do not use the same DNS for all the domains and there are no other discernible footprints from one blog to the next a ‘snooper’ could not necessarily tell these site were related.

    So if you had 2 VMBs with 20 sites each, each on of a different class C IP they could maybe figure out the 20 on one IP were related but not the 40.

    Or something like that…

  7. #607 | Posted November 4, 2009 at 2:55 pm

    Hey Jason,
    to create 1500 domains,
    I would get a dedicated server.
    Put all domains on that server.
    With an ip for each domain set.
    Use wordpress with Mulitblog for every 50-100 sites (domain set).
    Use one data base for each domain set.

    As for snoopers, I don’t understand your concern. but what ever you end up doing, there’s always a way to find your ip and server.
    whatever you end up doing, best of luck.

  8. Kane
    #608 | Posted November 10, 2009 at 7:32 am

    Seldom do you stumble upon a true internet king.You sir are one.I wish you all the success and happiness in the world.

  9. Robert
    #609 | Posted November 10, 2009 at 8:29 am

    Yes, definetely custom VPS or dedi.
    Some of the shared hosting companies have a maximum limit of 100MB, 200MB, etc on the database size.
    Once that size is reached, you have to create a new one.

    50 – 100 sites and a maximum database size of 200MB – 400MB is a joke.
    Look how we it’s being discussed by “the gentlemen” in this thread :
    http://www.webhostingtalk.com/showthread.php?t=888544

  10. Hub
    #610 | Posted November 12, 2009 at 7:54 am

    I am setting up 3 blogs on 3 different domains. The main WP install works, but nothing shows up on the other domains. Do I have to set up symbolic links for them?

    Thanks
    Hub

  11. #611 | Posted November 12, 2009 at 3:40 pm

    [...] A while ago a member of WPBlackhat posted a script to create virtual blogs (here: http://wpblackhat.com/forum/showthread.php?t=1327) on WP. The author of the script is Jason and is blog is here: http://striderweb.com/nerdaphernalia/features/virtual-m... [...]

  12. The Evil One
    #612 | Posted November 13, 2009 at 7:42 pm

    Very interesting reading. Some call you the Internet King with your 1500 posts. That’s very cool however, I must add several suggestions. First, the recommendations that you seek a dedicated server are certainly well founded but not optimal. What you really need to be considering is a cloud-computing environment. For example, You are concerned about snoopers, although that is valid the real concern is weighted SEO ranking and search result sets which is where you will gain your traffic to monetize all your domains and blogs Otherwise you are embarking on a losing proposition unless your altruistic behavior is one of posting all that info for free?

    SEO will negate duplicated content on multiple domains if the domains are on the same IP so be sure to group your domans for each set dynamically like diversifying a stock portfolio. Don’t put domains fo similar content together. This way if you cross pollinate blogs from one domain on another and cross link it will enhance the sites rating not negate it, (SEM 101).

    Second, I wouldn’t release all 1500 blogs all at once. If you release 1 blog per set for a period of 20 days, i.e. 1 doman per set each day and cross pollinate the links between sets and blogs, and register with goggle asnalytics, Google will see the econtent additions and immediately start moving you up the ranks as opposed to seeing all your content on day 1 and nothing else. You may even want to add the links to cross pollinate the blogs more slowly like every 2-4 days. That gives you three months of real search engine meat to make your ranking count. Time and volume count a lot in seo and sem.

    Three, a cloud will allow you to create an instance of your blog set, i.e. 20 blogs per set. The instance is made available in the cloud, which by its very nature has hundreds of IP addresses so your domains and blogs are automatically spread across multiple IP’s without you needing to manage every one by hand so to speak. Instead you manage your instances, adding your content, domains etc and letting the cloud do the rest. In this way, your effort is spread across multiple IP addresses without the great expense of dedicated servers as instances are charged to you based on use, not high idle times as most dedicated servers. For example, if you have a dedicated server, let’s say at a low price of $35/month, and it only has 20 domains with perhaps 10 blogs each for a while, the probability that it will be read 24 hours a day 30 days per month is highly unlikely. So why pay for all of that availability? An instance runs on a per hour basis at about $0.15 so your break even on the price is $35/$0.15 or 233 hours of use. That is about 8 hours a day for 30 days. If your blogs and domains are not accessed for that amount of time aggregated over a month, dedicated servers will kill you unless you are made of money, which I suppose if you are a King, perhaps you have. Second, most clouds have storage based pricing again cheaper then dedicated servers where you can do all your blogs in 1 db, mirror it for redundancy and have the db on the back end as an internal.your internaldomain.com. So for example, reserve 1 domain that will not host any site or blogs and make it your internal working domain whereby the db is accessed as db1.yourinternaldomain.com and db2.yourinternaldomain.com. You can load balance the db’s and use mysql bi-directional replication to make both dbs’ real-time current fully available for handling those peak volume times and yet still be cost effective.

    As I run about 80 domains myself and have loads of shared content across domains and sites I too am looking at this VMB solution for a similar but not the same solution. My simple question to Steve is this. How do I, using your solution, indicate which blogs to share across several domains while keeping others separate. I.e. if I have several travel sites, I want them to share their travel blogs regardless of which domain the blog was originating on, but if I also have a business consulting set of sites, I don’t want that content shared. Can I point all travel sites to the same db, or content directory and group them that way? What if I have subsets whereby travel for people with disabilities needs to be shared by a travel site and a non-profit site where the other travel topics are of no concern to the non-profit?

    I could use some help understanding how to set your solution up under this scenario.
    – The Evil One aka The Blind Guy.

  13. dndco
    #613 | Posted November 13, 2009 at 8:49 pm

    Sorry to burst your bubble, but you can’t run VMB in the cloud that I know of.

    It is my understanding that cloud hosts are not going to give you root access to make the DocumetRoot and OR sim link changes required. They are also unlikely to do that for you like most shared hosts are.

    If I am wrong about that let me know because it would be a nice solution.

    The best bet price wise is VPS, with mutiple Class C IP addresses. You can get a VPS for $35 a month, $1 per additional IP address. The trick is getting the from different C blocks. You can try asking up front or add IPs over time. I have done both.

  14. Robert
    #614 | Posted November 14, 2009 at 2:26 am

    For anyone looking at VPS servers, there is a good deal going on over at WHT. It’s called buy1get2 from subhosting.net.
    As the promo code implies, buy any of their fully managed VPS plans and get an exact same one for free.
    The owner Ivan is very interested in Internet Marketing, and is willing to learn about it, and he will help you with specific needs for your Internet Marketing.
    They also specialise in OpenX Ad Server optimisation.
    The link to the WHT thread (clear text so that you can see that it is not an affiliate link) :
    h___://www.webhostingtalk.com/showthread.php?t=903440

  15. Robert
    #615 | Posted November 14, 2009 at 2:27 am

    Forgot.
    @DNDCO: You can put that sledgehammer down now. LOL!

  16. The Evil One
    #616 | Posted November 14, 2009 at 4:52 am

    Robert,
    Nice idea with the VPS. If one was to create several accounts, they may get IP’s across several c-blocks. I set up VMB this evening to test it out. You are correct that google’s cloud does not give you access to the root user for the links, but AWS, Amazon, new cloud does. I had to do a little bit of work with DNS to get the internal domain working correctly using their s3 for storage and their EC2 for the application but so far it is working pretty slick. The speed from the various servers to the central replicated pair of databases is internal bandwidth so very fast. No delays like an Internet deployed db would encounter as its all gigabit connectivity with a strong backbone. Also, if the solution is for global deployment or at least to serve a global audience. AWS has clouds in USA, EU and Asia with dedicated connectivity between them. I run a Video server environment on AWS as well so am pretty comfortable with it. I should add that it was a royal pain in the arse to first get the instances up but AWS has better support and documentation now. BTW, I don’t use a sledgehammer…I use a Sickle. Lol!

  17. Robert
    #617 | Posted November 14, 2009 at 5:56 am

    Hi Evil One,

    You can just ask them for IPs from different C-blocks.
    When available you’ll get them. You can also have one VPS in their US DC and the other in their German DC’.

    BTW, I didn’t say anything about clouds, so I can’t be right about them. ;)
    I just thought that it was funny that the Mark Twain sized novel was smashed to bits with a couple of lines from DNDCO.

    I used to be an IBM AS/400 A/P. So I looked into Amazon EC2, because they offer IBM’s DB2 Express database, but it looked pretty expensive to me. Especially how I could not determine when the ticker starts and stops, and couldn’t determine the real usage hours of current sites that I wanted to move over to EC2. So I will install DB2 Express on a VPS myself sometime soon.

  18. The Evil One
    #618 | Posted November 14, 2009 at 3:37 pm

    Howdy,

    AWS does have a rather unclear policy on how they aggregate time for billing. There are two strategies for optimizing the AWS and similar type clouds. The first is to simply let them bill as they do while starting and stopping instances manually based on historical use and marketing synchronization times which is the least efficient way to do it but still is more cost effective then the VPS solution even with the offer above. The second is to play a game called “manage my instances”. This is where you set up your cloud using a master redirect, which starts and stops instances based on access requests. Thereby when a person requests a domain the instance is started, services the request and stopped minimizing use. In this way the hourly charge of $0.15 conserve up to several thousand requests and do it very inexpensively.

    As for the Dn.. comment. I equated his comment about his guy who runs a hosting firm helping with marketing to that of someone saying just because their grandmother can drive a car doesn’t mean she can rebuild an engine. If people valued that answer on the Internet marketing part of his comment, they have a lot to learn about Internet marketing and are in for a slow road to profitability. I did like the other half of his response and on a time vs. effort consideration his might be the best but it depends on how big you want to grow and what your scalability and budget is.

    On a last note, I inquired as to a scenario in my first comment that I have yet to have answered so if you or Dn or others know the answer, I would appreciate that.
    Thanks

  19. Robert
    #619 | Posted November 14, 2009 at 4:57 pm

    I assume that you meant the last paragraph.

    You directed your question directly at Stephen.
    And it’s a bit confusing what you typed up, at least for me.
    Because you mention content sharing between blogs. And that is not what VMB is about. VMB will actually do everything in its power to keep blog content (database tables) separated.
    But if what you meant is sharing the same database, then I think that you have to read up on VUSER and $table_prefix in the Readme : “If you use the same database for multiple blogs, you must set a different $table_prefix for each. If you don’t set $table_prefix, it will be auto-configured.”

    I stopped using VMB some months ago, in favour of WPMU.
    Reasons : No management in VMB, I bought BlogSlammer and Link Farm Evolution, the upcoming merger of WP and WPMU.
    I still have 4 blogs set up with VMB but did not do much with those the last couple of months.

    Let the master himself speak I would say.

  20. #620 | Posted November 17, 2009 at 9:38 am

    The information you’ve all been bouncing around is pretty good. I haven’t tested VMB with a lot of different hosting setups, which is why I’ve mainly let others carry the conversation.

    As to Robert’s last comment — he’s correct. VMB has nothing to do with sharing content between blogs. However, any method that works with two installs of WordPress will probably work with VMB.

    VMB is nothing more than a system for running multiple installs on a single set of files. Ideally, each blog should run **exactly the same as a regular WordPress install**; except that you only need to maintain and update a single set of files.

    If you want shared Admin, look to other solutions such as MU.

    If you want (for example) shared *users*, I would recommend looking at a plugin called wp-orphanage. It may need some tweaking, but is a great start down that path.

Pages: « 125 26 27 28 29 30 [31] 32 33 34 35 » Show All

Post a Comment

Your email is never shared.

Subscribe without commenting