|
假使有两个站点,site1.drupalla.com,site2,drupalla.com 首先复制sites/default -> sites/site1.drupalla.com sites/default -> sites/site2.drupalla.com 在sites/site1.drupalla.com/settings.php 下面修改代码: 1' g% C3 {5 z4 ], w/ O6 @# j$ ^
2
6 N( b- f; h/ {2 E3, b5 [) X4 M2 V% f1 N3 @6 i' H
4 K, m, B% H% W, Y' {
58 _) e( c9 I! j) r
6; i" c5 T# ?; a% l( X( ?) ]* `2 D
7+ \. B$ S3 _; z" x7 N
8
! P3 V' @0 S$ j& q s9* { A8 @' \: `( O! b5 N8 J9 e
107 s& A& s, |" G4 d. u4 `5 f( ~
11
; D0 p$ o; y* X: _! p8 |12
7 e0 c+ l- W/ b+ U, @+ B$ m | $databases['default']['default'] = array (0 j ~& n: Q6 ~3 N
'database' => 'db_site1',; `4 V6 H" E$ A( |! f
'username' => 'db_multi_user',
6 {0 g. e+ Z# T7 e* ?5 f 'password' => 'db_multi_password',
) Q1 E0 v3 L1 ^$ k( i. t 'host' => 'localhost',
" M2 i' s* e( t: y( v4 _ 'port' => '',
- y9 B3 b# z' |; ? 'driver' => 'mysql',) a' a$ l5 c" f2 @/ h
'prefix' => '',
+ o; m. e9 x. j7 m* b );2 H: N1 e% n0 x y' f
// Read more about this variables in settings.php" _% @) [: _- G5 S3 I
$base_url = 'http://site1.drupalla.com';+ S$ X1 _, v7 r; N
$cookie_domain = '.drupalla.com'; // 这段能让网站单点登录,前提是多站点都是同一个域下的二级域 |
在sites/site1.drupalla.com/settings.php 下面修改代码: 1
( s3 u; m0 C, Y2
3 G' I( W4 K" I+ ]" b! L9 T" Z3& J$ X. _6 E8 G( p
4
3 t6 b9 w$ `* ^3 l3 ?5
" }! e/ d! H+ w0 b+ { m: U' m/ o6
& V3 G) M- M+ T1 o8 S& h% G8 P7+ P1 Q& ]7 w% @" } }. I5 \
8
0 Q+ T- \, c6 m$ ~2 d( J! F9' v1 P: l1 V3 P8 p& x! w' D
10% |$ ]8 F$ b& Q9 U
11
7 }5 p1 q& [( U9 U( s126 {) C. N# ]' G0 x9 Y
13- }# Q% K3 m( D* n: W6 u+ w: k1 _
14
+ @) M. @) \6 {15* n, ?& h0 Z! Y) m* O4 _; B2 H' P
16; e$ X/ u9 O3 ~
17" X: L! C D2 [4 y* k0 k- Z+ l0 p
18# Z" d% ?" F1 F3 R4 z" C( ^
19
; O) c4 a" |# O | $databases['default']['default'] = array (9 P$ f! ?7 M* y- l
'database' => 'db_site2',
9 v- [# q; u5 u6 o 'username' => 'db_multi_user',+ H0 Y% W. k& D" q5 f
'password' => 'db_multi_password',/ s- ~& j# k3 m1 Z2 ^+ O, t
'host' => 'localhost',* ~; i( x" \2 H
'port' => '',
; [ i7 @ ~# l7 k1 m9 P 'driver' => 'mysql',
! j, s; s. I* G) i* S 'prefix' => array( g$ L1 A8 `1 O" b
'default' => 'db_site2.',( z0 y7 i* _0 r8 M) {, J# }2 h T+ @: R
'users' => 'db_site1.',
8 v5 }! w- e7 e m7 N 'sessions' => 'db_site1.',
; w0 G: d- N0 R( w4 T( s x( ?" q 'role' => 'db_site1.',
$ s; L5 I+ h3 D8 P 'authmap' => 'db_site1.',, g+ _" ^' _8 M* S, S1 F" K, Y
'users_roles' => 'db_site1.',
8 n [- I7 w4 L0 } ),. U; {5 j, y1 M6 K: j3 g7 K9 H
);% y4 Y# P, I( d+ t" E5 C4 ^- n
// Read more about this variables in settings.php7 y5 R7 E% ^; l& [3 F
$base_url = 'http://site2.drupalla.com';
) F# h5 r$ U( ^- w! P V. D$cookie_domain = '.drupalla.com'; |
确保两个站点的文件夹sites/site1.drupalla.com,sites/site2.drupalla.com权限是666 确保sites/site1.drupalla.com/files,sites/site2.drupalla.com/files权限是777 site1.drupalla.com , site2,drupalla.com 指向服务器ip, 成功后,浏览器分别打开site1.drupalla.com 安装, site2,drupalla.com 安装
本文选自:猪跑啦,谢谢诗人! |