Howto: Run Multiple Poor Mans BANS Sites Using 1 Wordpress Installation

Note: This is a follow up to the original Make Money With a Poor Mans BANS (Build A Niche Store) post. If you haven’t read that post, please do so before continuing with this one.

Robert made a fantastic suggestion in the original Poor Mans BANS post. After deploying several Poor Mans BANS sites, maintaining and upgrading each site soon became a cause for concern. Thanks to Robert’s suggestion, that’s no longer an issue.

Here’s an excerpt from the post Robert kindly shared:

Stephen Rider [striderweb.com] has released a modification for WordPress that allows you to run multiple blogs off of a single WordPress installation.

See where this is going? This awesome modification has an easy to use configuration system that enabled me to convert all of my Poor Mans BANS sites over to a single Wordpress installation in less than 10 minutes. Here’s a run down of the details and steps involved.

Before - 5 domains, 5 separate Wordpress installations

  • www.domain-1.com --> /var/www/domain-1.com/http/
  • www.domain-2.com --> /var/www/domain-2.com/http/
  • www.domain-3.com --> /var/www/domain-3.com/http/
  • www.domain-4.com --> /var/www/domain-4.com/http/
  • www.domain-5.com --> /var/www/domain-5.com/http/

After - 5 domains, 1 Wordpress installation

  • www.domain-1.com --> /var/www/virtual-press/http/
  • www.domain-2.com --> /var/www/virtual-press/http/
  • www.domain-3.com --> /var/www/virtual-press/http/
  • www.domain-4.com --> /var/www/virtual-press/http/
  • www.domain-5.com --> /var/www/virtual-press/http/

5 domains, 1 folder to maintain, perfect. So here’s how it’s done. First, download the mod from Stephen’s web-site. Extract the contents of the archive to the base (core) Wordpress installation /wp-contents/ folder.

You should now have something similar to:

/var/www/virtual-press/http/wp-contents/multiblog/

Inside the /multiblog/ folder is another directory labeled config. This is where the magic happens.

Open up the file config/mb-users.php in your favorite text editor. A vusers[] entry is needed for each domain you intend on serving from the single Wordpress install. Here’s an example mb-users.php file:

<?php
if ( !defined('ABSPATH') ) exit(); // sanity check
$vusers[] = 'domain-1.com';
$vusers[] = 'domain-2.com';
$vusers[] = 'domain-3.com';
$vusers[] = 'domain-4.com';
$vusers[] = 'domain-5.com';
$mydomain = '';
?>

So far so good, right? Now, open up config/mb-config-sample.php. The contents of this file should look familiar to Wordpress users. Insert the database information for domain-1.com and save the file in the following format:

mb-config-domain_1_com.php

If the domain was www.elite-ebay-power-seller. com, you must save the file like this:

mb-config-elite_ebay_power_seller_com.php

If you’re unable to use these examples to determine what’s right for your domain, let me know in the comments below and I’ll try to help out. Repeat this process for all your domains. Based of the conditions outlined in this post, the /wp-content/multiblog/config/ file listing should now look like this:

mb-config-domain_1_com.php
mb-config-domain_2_com.php
mb-config-domain_3_com.php
mb-config-domain_4_com.php
mb-config-domain_5_com.php
mb-users.php
mb-autoconfig.php

Ok, we’re almost done. The last step is updating your http daemon’s settings. You must tell your http server to point all those domains to the base Wordpress directory.

Here’s how this is accomplished with Lighttpd (lighttpd.conf):

$HTTP["host"] =~ "www.domain-1.com|www.domain-2.com|etc..|etc..." {

server.document-root = "/var/www/virtual-press/http"

}

Restart your http daemon so the new settings will take effect. If all goes well, your sites should function properly with the exception of maybe some plugins and themes. This is easily resolved by copying them over from the original document root to the new base installation (which is the new document root).

In my case, a couple of my sites used the same theme but with a different header/logo. To prevent domain-1.com from displaying domain-2.com’s logo, I simply made a copy of the theme to isolate the files.

/var/www/virtual-press/html/wp-content/themes/themeA-domain1.com/

/var/www/virtual-press/html/wp-content/themes/themeA-domain2.com/

Login to the admin panel and select the appropriate theme for the domain. This will keep your Analytics, Adsense, and graphics in order. That’s it!

My gratitude goes out to Robert for sharing this wonderful modification and Stephen for writing it. If you enjoyed reading this post and would like to read more like it, please consider subscribing to my full length RSS feed. And as always, comments are encouraged.

Additional Posts Worth Reading

 

3 Comments »

collapse Comment by Ralph Branson
2008-04-12 18:47:55

“The last step is updating your http daemon’s settings. You must tell your http server to point all those domains to the base Wordpress directory.”

If you do this don’t you get the same content on the different web sites?

I want independent blogs on different sites using one WP install.

Thx,

Ralph

collapse Comment by Guy Patterson
2008-04-17 11:57:12

negative. the multi-blog plugin will know what to do depending on the domain and how you’ve configured/setup the plugin. All my “virtual blogs” point to one public_html directory, and the multi-blog plugin knows what to serve up based on the domain name.

-Guy

 
 
collapse Comment by twincascos Subscribed to comments via email
2008-05-06 19:25:24

Hello, I’m trying to set this up, thought you might be able to help. my sub domains keep redirecting back to my main domain. Any help or feedback would be greatly appreciated.

domain:http://www.domain.com/ subdomain:http://art.domain.com/ subdomain:http://near.domain.com/

mb-users.php file: $vusers[] = ‘domain.com’; $vusers[] = ‘art’; $vusers[] = ‘near’; $mydomain = ‘domain.com’;

mb-config-art.php mb-config-near.php mb-config-domain_com.php

sub domains configured in cpanel point to /public_html

htaccess: # BEGIN WordPress

RewriteEngine On RewriteCond %{REQUEST_URI} (/art|/near)?/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . %1/index.php [L]

# END WordPress

main site admin dashboard: Virtual Multiblog

Virtual Multiblog Diagnostics WordPress version: 2.5.1 Multiblog version: 2.2.2 Multiblog Plugin version: 2.2 PHP version: 4.4.8 MySQL version: 4.1.22-standard-log ABSPATH: /home/user/public_html/ VUSER: domain.com $_SERVER[’SERVER_NAME’]: www.domain.com $_SERVER[’PHP_SELF’]: /wp-admin/index.php $_SERVER[’HTTP_HOST’]: www.domain.com $_SERVER[’SCRIPT_NAME’]: /wp-admin/index.php $_SERVER[’DOCUMENT_ROOT’]: /home/user/public_html End Diagnostics

I’m at a loss, having tried numerous variations. Thanx again for any suggestions.

 
Name (required)


E-mail (required - never shown publicly)


URI - Web Site Address






Subscribe

Site of The Day

Sponsors

Categories

Recent Comments

  • Arthur: I can’t even be an Ebay affiliate. Tried various ways but still declined. Any help or suggestions?
  • chicago web design: I can’t imagine that these will last very long before Google banishes them all. But for now...
  • D.Ksyte: Anyone involved with cron job scheduling might find this resource useful. Cron Sandbox at HxPI is an...
  • FoNiX: “…decode md5″ is not possible, only bruteforce: generate hash and compare with original.
  • Z@$#: plz plz decript this hash for me any one….its really important…. 2CAD28C7C619F27DDE7B83C4999795BA
  • Joe: Thanks for writing this up. I tried the second method…however after the debian install the screen looks...
  • Scott: Was this issue ever resolved? I just started having a problem a couple weeks ago. I don’t do any kind of...
  • Prashant Patel: I had integrated Sp3 in Xp But finding one problem. In the Task Manager Process windows many services...
  • Ed: This looks like a real ‘leet’ linux command but it misses the point. Why would a hacker keep the name of...
  • Sudesh: My account was disabled but I followed their guideline and in one sec it was back on :) Here is the...

Top Commentators

Miscellaneous

  • Add to Technorati Favorites