Q: Trying to figure out a smart way to approach multiple sites

Events happening in the community are now at Drupal community events on www.drupal.org.
slayerment's picture

In short, I am looking to achieve something like what CNET is doing with its entertainment sites such as www.gamespot.com, www.tv.com, www.mp3.com, etc.

I do not know much about servers so this is a big weakness of mine. What I would like to achieve is something that allows for all my sites to run from 1 set of modules and 1 database (if that's the smartest way to do it). I would actually prefer to have each site on its own database and then a separate database that shares all the user info while still using one codebase of modules and drupal core.

I have checked out some dedicated servers and they seem okay, but it looks like with a lot of these I am back to the cPanel route. Since most of my sites will feature ecommerce and need SSL type requirements I don't think I can really handle multiple SSLs on one cPanel install.

Does anybody have any advice on how people like CNET or Yahoo share all their user info? Is it similar to Drupal? Do they have tons of servers all synced up correctly? This stuff seems way over my head, but I really would like to do it. Perhaps I need to hire a professional to go through this with me.

Any type of advice on any of these questions would be greatly appreciated.

Thanks,
Quinton

Comments

What type of environment?

Doug Ouverson's picture

I spent 5 weeks getting this figured out, only to find out it was fairly simple; these things always seem simple after you've figured them out - "simplicity on the far side of complexity" or something like that.

I could share what I did, but it may not help you: depending on your server environment. If you could share a bit more about your server and development environment, then I might be able to assist.

========
Doug Ouverson

ramper's picture

Hi, I'm new to this group, sort of new to Drupal, but pretty excited about 'what's possible' to do with Drupal...
I just wonder, why there was no further discussion on this thread...I'd be grateful if anyone could share their insights, experience,....

I'm setting up a community website - but I anticipate that at some point, I would like to spin off certain topics into a subdomain, but still with same user login and all...Also, some of the content will be shared. For example, headlines of content created in one of the subdomains would show up on the main site - so, a user clicking on a link from the main site should be taken to the subdomain, but with the same user login. I would really like to use separate MySQL databases - because, with my limited knowledge, it seems like that would be more efficent, especially since my hosting package makes several databases available anyways...

This is what I found so far:
The 'multisite manager' module looks interesting - though the author admits that the configuration could be messy...

The Organic Groups Sites module looks attractive - but specifies that the database needs to be common between the sites. I am just worried about the site slowing down at some point with a database bloated with too much content. Also, there is an upper limit on the MySQL databases on some of the basic hosting packages, upper limit on the SQL file import, etc. (I'm a newbie - so please bear with me... :)

Is there a way to achieve all of the objectives:
Multiple subdomains (let's say, multiple sites) with related content
Shared user login
Separate MySQL databases
Same Drupal codebase (of course)
?

Sharing content is messy.

Michael Hofmockel's picture

Its the shared content that is the biggest issue!

All other objectives are being done with much success and with out the need for additional modules (maybe need single-sign on).

Sharing code is easy. Sharing users is do-able (couple modules can help with single-sign on). Separate databases is advisable. Sharing content is messy.

Organic Groups is not a bad solution. Each group can have their own theme. To the user this would feel like different sites. And the perception of shared content is maintained. One site so single sign-on is not needed.

re content bloat: If a host has a limit on the size of a database they also have a limit on the number of databases too. So separating your content into multiple database doesn't solve your problem you just bump into another limiter.

If you really expect a lot of content pick a host that can handle the content load (Drupal can handle it) or is at least willing to renegotiate after the fact.

Regards,
Michael Hofmockel

Open Source || Open Access || Open Mind

Thanks for the reply,

ramper's picture

Thanks for the reply, mhofmockel . I'll do a trial install with whatever info I've found so far. But my question still remains - OG Sites module says it's meant to be used with a single database, but I plan to use different databases. So how to share the user info across databases...

To clarify on the database size limit, I get 25 databases of 100 MB each - so, if I use multiple databases, the total size seems more than adequate (based on my test site). Sure, I will go for an upgrade when the situation warrants it :)
Thanks for your reply. If you think of anything on sharing the user info across sites that use different databases, please do reply...

OG sites not recommended - no new development.

Michael Hofmockel's picture

The Author of the OG sites module is not developing it any further. It is not ready for a production site as it has not been released as a full version yet. Unless you want to help develop it further I would avoid that module.

For my projects that want sub-sites and shared content I use the Organic Groups module (not the OG sites module) and supply separate themes for each group. So really it is just one site with several themes for different sections.

Definitely persue separate databases. Will allow you to pull these things apart later and manage easier.

Sharing users is easy with prefixing. Here are two excerps from my settings files that produce shared users and separate databases. The '.' at the end of the prefix allows you to jump databases.

settings.php from site one
$db_url = 'mysql://drupal:ilovedrupal@localhost/main';
$db_prefix = array(
'default' => 'main.',
);

Settings.php from site two
$db_url = 'mysql://drupal:ilovedrupal@localhost/test';
$db_prefix = array(
'default' => 'test.',
'access' => 'main.',
'authmap' => 'main.',
'filters' => 'main.',
'filter_formats' => 'main.',
'permission' => 'main.',
'role' => 'main.',
'sequences' => 'main.',
'sessions' => 'main.',
'users' => 'main.',
);

Might want to add profile tables if you use that module.

Regards,
Michael Hofmockel

Open Source || Open Access || Open Mind

multi site with single user DB

unodewaal's picture

This sort of worked for - I've can sign in to two different sites using the same user/pass setting (in my case universal/universal).

My settings.php file in my 2nd site looks like this:

$db_url = 'mysql://root:password@localhost/test';
$db_prefix = array(
'default' => 'test_',
'users' => 'drp_',
'sessions' => 'drp_',
'role' => 'drp_',
'authmap' => 'drp_',
'sequences' => 'drp_',
);
Where test = the prefix for the 2nd site, and drp is the prefix for the main site.

I had to use a single DB with 2 prefixes inside that DB - I found that part to be very NB.

So in mysql:
single database, but segmented using prefixes (I assume this isn't the best way to go forward?)

But interestingly - I'm running this weird setup:

I have this 2nd site runnning off a totally different drupal install because I was doing stuff so quickly I was too lazy to create a subsite in drp/sites.

Universal is running off drupal/sites (which I couldn't get figured out)

Thanks for the tip - will try it out

ramper's picture

Hi mhofmockel , here's a late 'thank you' for your tip - haven't been on this site for about a week now (just set up my 'triple boot' system :)...
I have never ventured beyond the basic set up of MySQL databases - so if I can get this to work, that would be great indeed. In the shared hosting package I have now, the databases are located in a separate server from the one where I have my Drupal files. So I wonder if, according to your suggestion, the 'main' database would require some form of authentication before it allows access (or 'lookup?') by the 'test' db. If that doesn't work, I am considering upgrading to a VPS package. Anyhow, this seems like a workable idea. Thanks for your time.
Also, thank you so much for the info. on the OG sites module - I was looking for a 'multiple db' kind of set up anyhow, but it's good to know. Thanks again.

no special authentication required assuming ...

Michael Hofmockel's picture

If the two databases reside on the same DB server and use the same mysql user to authenticate against the database it doesn't matter the DB server is a separate box.

Just change "localhost" to the name of your server in line one of the excerp above.

But I still think your notion of sharing content between sites is not fully fleshed out in the Drupal community and will require some work on your part.

Regards,
Michael Hofmockel

Open Source || Open Access || Open Mind

But I still think your

ramper's picture

But I still think your notion of sharing content between sites is not fully fleshed out in the Drupal community and will require some work on your part.

Yes, I'm beginning to realize that...in particular, I have no idea as to what's going to happen to taxonomy. If you have thoughts on this, please do share. It seems to be a worthwhile exploration for me, though I'm still a beginner...thanks again for your responses and tips.

sharing user tables

tringuyen's picture

where can i find specific and detailed information about a multi-site configuration where content tables are separated out and user tables are shared?

thanks

Multisite

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: