my first multisite with shared users

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by ymazigo on April 3, 2011 at 5:29pm

here are steps for creating multisite with shared users that work for me please add any idea if you have

you must know how to setup vhost in apache

our domain for the site will be

http://example.com
http://site1.example.com
http://site2.example.com

  1. first install drupal normally (we will call the database for drupal installation drupaldb)

  2. after install drupal navigate to phpmyadmin or use mySQL gui tools and look for the database drupaldb (database you created previously )
    and look for these table

    'users' rename to 'shared_users',
    'sessions' rename to 'shared_sessions',
    'role' rename to 'shared_role',
    'authmap' rename to 'shared_authmap',

use phpmyadmin or use mySQL gui to rename these table

  1. after rename these table of your database go to drupal installation folder and go to sites->default and edit settings.php as follow

$db_url = 'mysqli://username:password@localhost/drupaldb';
$db_prefix = array(
'default' => '',
'users' => 'shared_',
'sessions' => 'shared_',
'role' => 'shared_',
'authmap' => 'shared_',
);

after edit save the file and refresh browser to see if the site (http://example.com) is working. if it work then we are good to go.

  1. Go to drupal installation folder and go to sites-> and create folder called site1.example.com and copy default.settings.php
    from sites->default and paste to new folder you created site1.example.com and rename default.settings.php to settings.php

  2. go to browser site1.example.com and install drupal as follow
    install drupal in database configuration type the same database you created in http://example.com which is drupaldb and in
    Advanced options on Table prefix: write site1_ and finish the installation.

  3. now go to sites->site1.example.com and edit settings.php as follow

$db_url = 'mysqli://username:password@localhost/drupaldb';
$db_prefix = array(
'default' => 'site1_',
'users' => 'shared_',
'sessions' => 'shared_',
'role' => 'shared_',
'authmap' => 'shared_',
);

and save

that it when you create user on example.com you will be able to see on site1.example.com

do the same on site 3

Comments

Which version of Drupal?

Posted by davidwheelerphd on April 3, 2011 at 5:58pm

Please state if you are using Drupal 6 or Drupal 7
Thanks.

d6 v d7

Posted by yugongtian on April 4, 2011 at 6:29am

$db_prefix - it looks like d6 .I think the D7 use 'prefix'

I'm using d6.20

Posted by ymazigo on April 4, 2011 at 2:11pm

I'm using d6.20

Hi. HAve you upgraded it to

Posted by sacp on March 20, 2012 at 12:05pm

Hi.

HAve you upgraded it to D7 ?

Multisite

Group organizers

Group notifications

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

AltStyle によって変換されたページ (->オリジナル) /