欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

Drupal 7 多站点设置如何实现单点登录?

Drupal 7 多站点设置如何实现单点登录?

赞成!0否决!

我用drupal 7 建立了多站点架构,如何能做到只登录其中一个站,其他站就不需要重复登录?

单点登录

(0) 是的(0) 一点点(0) 没帮助

JedielLV 11

  • 7 年前提出该问题

  • 324

1 个回答

赞成!1否决!

举例:

假使有两个站点,site1.drupalla.com,site2,drupalla.com

在sites/site1.drupalla.com/settings.php 下面修改代码:

1
2
3
4
5
6
7
8
9
10
11
12
$databases['default']['default'] = array (
   'database' => 'db_site1',
   'username' => 'db_multi_user',
   'password' => 'db_multi_password',
   'host' => 'localhost',
   'port' => '',
   'driver' => 'mysql',
   'prefix' => '',
  );
// Read more about this variables in settings.php
$base_url = 'http://site1.drupalla.com';
$cookie_domain = '.drupalla.com';

 

在sites/site1.drupalla.com/settings.php 下面修改代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$databases['default']['default'] = array (
   'database' => 'db_site2',
   'username' => 'db_multi_user',
   'password' => 'db_multi_password',
   'host' => 'localhost',
   'port' => '',
   'driver' => 'mysql',
   'prefix' => array(
    'default'   => 'db_site2.',
    'users'     => 'db_site1.',
    'sessions'  => 'db_site1.',
    'role'      => 'db_site1.',
    'authmap'   => 'db_site1.',
    'users_roles'   => 'db_site1.',
   ),
  );
// Read more about this variables in settings.php
$base_url = 'http://site2.drupalla.com';
$cookie_domain = '.drupalla.com';

(4) 是的(0) 一点点(0) 没帮助
分头诗人的头像

分头诗人LV 17

  • 7 年前回答该问题


来自  http://www.drupalla.com/node/290

普通分类: