Quantcast
Channel: Recent posts across whole site
Viewing all articles
Browse latest Browse all 49206

my first multisite with shared users

$
0
0

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


Viewing all articles
Browse latest Browse all 49206

Trending Articles