Thứ Ba, 23 tháng 7, 2013

my first multisite with shared users in drupal

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
  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 inhttp://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

Không có nhận xét nào:

Đăng nhận xét

Học lập trình web căn bản với PHP

Bài 1: Các kiến thức căn bản Part 1:  https://jimmyvan88.blogspot.com/2012/05/can-ban-lap-trinh-web-voi-php-bai-1-cac.html Part 2:  https://...