Multi-site Questions, how to

public
group: Multisite
Dixen - Thu, 2008-05-15 02:22

Greetings,

I have been using drupal for more than a couple years now, but never used a multi-site set-up before. Recently a client expressed a desire for a setup that I think will be best served by a multi-site setup. Here's what I need:

http://example.com
http://example.com/site_i
http://example.com/site_ii
http://example.com/site_iii
http://example.com/site_iv

-> 5 sites total, each would have it's own content. Blocks, modules, etc would be the same from site to site (at this point in time), there may be a future need for different modules/etc.
-> I'd like to share logins/sessions, but permissions could be different from site to site. If permissions have to be the same I can deal with that.
-> Templates will be the same throughout each site, but will be different "color sets". This can easily be dealt with by separate templates, but updates would be a pita.
-> This is a Windows Server, running iis and mysql. Having read through much of the multi-site documentation on d.o most of it deals with the linux environment and as much as I would like to move this client to a linux machine so I have a hope in hell of understanding what to do with the thing he has other "applications" running on the server that must run on a windows os.

That's it in a nutshell. I'm guessing this is going to be relatively simple, just time consuming I thought I would come here and see if i could get some help from those who have done this sort of thing in the past.

Thank you.

Many ways to skin a cat

edward.peters@drupal.org's picture
edward.peters@d... - Thu, 2008-05-15 07:48

Hi Dixen, there are many ways to skin this particular cat. Others with more technical savvy than me will have more useful comments, but as I have been wrestling with some of the same issues for a non-profit project (www.drupalproject.iofc.org) for nine months, I can offer one or two comments:

  1. Sharing sessions across domains is difficult or impossible unless they are subdomains, as Drupal uses a domain cookie. So, site_i.example.com could share sessions with example.com and other subdomains but the five examples you gave could not.
  2. You might want to consider table prefixing by domain for some but not all tables. In our solution we are prefixing quite a number, to allow customisation by domain for some basic components.
  3. Does the thread and post at http://groups.drupal.org/node/7725#comment-25357 help?

Good luck!


Good Read!

Dixen - Sat, 2008-05-17 02:38

Edward,

I read though the thread you listed in #3. Thank you, that thread and the others linked to in it were a big help.

I decided to use a subdomain approach with a shared database specifically for users and sessions ... Can you help me with the table list that I need to share to do so? I know the array has to go into settings, but I'm not sure of all the tables that need to be shared.

Thank you!

Okay, trying these ...

Dixen - Sat, 2008-05-17 07:45

Tried the following, seems to be working for the sharing of dbs ...

$db_prefix = array(
'default' => 'main_',
'users' => 'share_',
'sessions' => 'share_',
'role' => 'share_',
'authmap' => 'share_',
'sequences' => 'share_',
'users_roles' => 'share_',
);

Yeah, there's a bunch of

ixlr8's picture
ixlr8 - Thu, 2008-05-15 22:49

Yeah, there's a bunch of ways to do this. is there a reason in particular why you want it as example.com/site_1, example.com/site_2, and not site1.example.com, etc?

As far as logins/ permissions go, have you considered the use of openID? Another option is sharing a database between your sites, but that all depends on what kind of traffic you're going to be expecting.

Regarding using a windows machine, you might run into issues. Keep plugging at it, and you'll be ok. Just make sure you have an IIS expert around who can help you when you break something. I'd strongly suggest using Linux, and just have your applications on a separate server if need be, but thats just my opinion.

Mike


Hey Mike, I'd love to be

Dixen - Fri, 2008-05-16 20:33

Hey Mike,

I'd love to be using linux... but they don't want to spend the extra money on another server ATM. Believe me, I have been all over that trying to find a way to get things moved over.

As to the site layout, perhaps I am approaching this in the wrong manner... but the whole reason for the multi site consideration is that each "site" will have the same type, but different content, and a different theme, while the default site will have general information. Let me explain further ...

This project is going to be geared towards various transportation industries; road, rail, maritime, and air... the content for each site will be based on the various rules, regulations, and etc that exist for each industry, while the content for the default site will be generalized for the company that is providing services. The template will be the same for each site, but will be different colors (i.e. color picker, garland).

Is there any other way to achieve this other than a multi site setup?

Domain Access

agentrickard@drupal.org's picture
agentrickard@dr... - Sat, 2008-05-17 19:54

Domain Access can do this as well -- allowing content to be shared across multiple sites from a single database and installation, but it's workflow might not appeal to you.

http://drupal.org/project/domain

--
http://ken.therickards.com/


you can do this with

tomhung's picture
tomhung - Tue, 2008-07-15 22:03

you can do this with symlinks

lets say this is your config

here is your docroot
/opt/www/drupal/
example.com is pointed here
it uses the sites/default config

you need to add symlinks for site1 & site2

cd /opt/www/drupal
ln -s /opt/www/drupal site1
ln -s /opt/www/drupal site2

then setup the sites/ dir as docs specify

sites/example.com.site1
sites/example.com.site2

I just set my projects site up like this.. I hope it helps.

G