I am curious if there are any modules for Drupal 6.0 that can handle multisite.

I am setting up a new site, and need to have like:
www.domain.com
sub1.domain.com
sub2.domain.com

I am wondering if there are any tutorials on this for 6.0 or modules to assist.

Thanks.

Comments

UCFPowell’s picture

I meant to mention.. I want users shared to all subdomains, but I want content to be seperate.

I guess I am afraid that if I do...
www.domain.com/about/
sub1.domain.com/about/

They could overlap.

WorldFallz’s picture

a search with "multisite shared users" returned the following (2nd link):

Multi-Site, Single Codebase, Shared Database, Shared Sign-on 5.x

appears to be exactly what you are looking for. The title is a little misleading-- it's not completed shared db, just shared user info. But the scheme layed out looks like it can be altered to share pretty much in anyway you want.

EDIT: another thought.. you might be able to setup a standard drupal multisite environment and just replicate the user tables at the db level.

UCFPowell’s picture

Can you provide me with a link for that...
"standard drupal multisite environment"

Thank you for your response though.

Also the link you supplied says 5.x is that compatible with 6.0?

Thanks again.

Update:
http://www.example.com/site_1/install.php
http://www.example.com/site_2/install.php

Is the example you linked to... I am looking for like http://site1.example.com/ I want subdomains rather than folders.

WorldFallz’s picture

Sure thing:

From what I can see, multisite hasn't changed much d4.7 -> d5 -> d6.

The documentation makes it look complicated though. After I worked through it myself i realized it's actually very easy. the basic steps are:

  1. create separate dbs for each site
  2. d/l and install drupal for the main site
  3. create sub directories for each subsite under the /sites directory of the main site by copying the "default" directory and renaming it after the domain of the subsite (ie sub1.example.com, sub2.example, com, etc.)
  4. edit the settings.php file in each subsite's directory to reflect the specific db for that subsite. Note that you'll have to remove read-only before you make the change and then change it back to read-only when you're done. Very important-- be sure settings.php is read-only.
  5. set up apache virtual hosts for each site and point them to the root directory of drupal, NOT the directory of the subsite. This is important-- drupal does the work of managing the redirects to the subsites, not apache.
  6. You don't mention if you're setting up a localhost env, but if you are, you need to edit the hosts file also to add an entry for each site (ie 127.0.0.1 www.example.com, 127.0.0.1 sub1.example.com, 127.0.0.1 sub3.example.com, etc). If using a hosted service, they should take care of this when you create the subdomains. At least the ones I have shared accounts on do this when I add a subdomain with cpanel.
  7. visit the url for each of the subsites and run the drupal install.

that's pretty much it. But with that setup the sites will all have completely separate dbs. You could do that, then setup replication for the users table and see if that gives you want you want.

Another option I just thought of-- you could create a little custom module and use hook_user to catch the user creation action and add some code to loop through the INSERT action for each subsite you have. I'd actually probably do that-- this way the user gets all accounts at once and you don't have to replicate on the db (which will have some period of time where the account is not active on all sites at once).

And, of course, you could always just follow the article I listed in my previous post. Multisite hasnt changed much I don't think, so it should work, but you'll have to test it out to see.

WorldFallz’s picture

Is the example you linked to... I am looking for like http://site1.example.com/ I want subdomains rather than folders

I should have pointed out that's actual trivial... I'm pretty sure drupal doesn't care. However you name the directories under /sites is how drupal will see them: www.otherdomain.com, sub.example.com, www.example.com.site1, etc.). At least that's been my experience so far.