Hi,

I am trying to setup multiple sites which share the tables by using prefixes. Pls refer http://drupal.org/node/2622

I was able to do it in drupal 4.7.4. But i cant find out a method to do it under drupal 5. First thing is i could not find the database script for drupal 5.

Next thing i tried out was to specify the prefixes in bootstrap.inc during installation. I was able to successfully install the database and drupal on both the sites individually. But when i create a shared prefix, I am able to login on the first site, but the second site simply sends me to the login page again and again. It does not accept the login that was created for the first site, even though the tables are shared. I am unable to create a login for the second site. Has anyone tried to do that. Am i doing something wrong?

I am new to Drupal, so please excuse if something is blatantly stupid.

Regards

Comments

bcn’s picture

Hi,

I was also trying to get a multi-site (as sub-domains)/multi-db configuration going without success in drupal 5...

I have read through many posts, handbook pages, and lists, and i have come to to believe it is not currently possible in v5.0 for *some unknown* reason. Everyone claims its possible so maybe its just me or my host (apache, cpanel) but i cannot figure thias one out.. I will check back here to see if you have more success than I did (multi-site is working fine, but each site has its own db).

My problems seemed to centered on not being able to connect to different databases from the db_prefix array...
I tried some things (in settings.php) like:

<?php
$db_prefix = array( // Don't forget to place periods after database name.
  'node' => 'my_main_db.',
  'user' => 'my_main_db.',
  'role' => 'my_main_db.',
  'favorites' => 'my_3rd_party_db.',
);
?>

and

<?php $db_url ['default'] = 'mysql://user:pass@localhost/db_default';
// $db_url ['shared'] = 'mysql://user:pass@localhost/db_authentication';?>

References: (http://drupal.org/node/22268, http://drupal.org/node/53320, http://drupal.org/node/18429 , http://drupal.org/node/18429 , http://drupal.org/node/92675 , http://drupal.org/node/2622, http://drupal.org/node/76259 , there are more...)

msbrar’s picture

OK, I got that to work. Had to write session_write_close() at the end of index.php. Dont remember the place where i found that.

PS: And the single sign on works tooo:)

Regards
Mandeep

denney’s picture

I'm having, what I believe, is the same problem.

I have installed 1 website at http://www.example.com.

I then create a "subsite.example.com" directory inside the "sites" directory. I copy the settings file from the main site to the new directory.

The tables are configured as follows:

main site db prefix = "d5_"
main site "users related" db prefix = "shared_"

subsite db prefix = "d5subsite_"
subsite "users related" db prefix = "shared_"

Now, when I go to the "http://subsite.example.com" website I expect it to spit up errors because the database tables are not created. Sure enough, it does.

Try running "http://subsite.example.com/install.php".... no go. it says it's already installed.
Try running "http://subsite.example.com/update.php"... no go. it says I need to login.

Sure enough, there's no database schema so I can create these new database tables.

denney’s picture

Fixed it. I just had to disable the access check in update.php until after i have updated to the latest revision.