/[drupal]/contributions/modules/multisite_manager/INSTALL.txt
ViewVC logotype

Contents of /contributions/modules/multisite_manager/INSTALL.txt

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (show annotations) (download)
Fri Feb 8 20:25:25 2008 UTC (21 months, 2 weeks ago) by schuyler1d
Branch: MAIN
CVS Tags: DRUPAL-5--1-0-1, DRUPAL-5--1-0-BETA2, DRUPAL-5--1-0-BETA, DRUPAL-6--1-0-ALPHA1, DRUPAL-5--1-0, HEAD
Branch point for: DRUPAL-5, DRUPAL-6--1
Changes since 1.3: +28 -1 lines
File MIME type: text/plain
http://drupal.org/node/196601 Delay the creation of nodes with a batch script, and small tweaks
1 INSTALL INSTRUCTIONS
2 ====================
3 0. INSTALL THE MODULE
4 *Put multisite_manager directory in your modules directory--most likely
5 you will just put it in the master site's modules directory.
6
7 *For those running versions less than Drupal 5.7
8 ----------------------------------------
9 If you will be configuring multisite_manager to create new
10 databases (rather than just alter table prefixes) you will need to
11 update your core drupal files with the latest patch in this bug
12 report:
13 http://drupal.org/node/168315
14
15 Assuming you will make all new sites available at /site/{shortname}/
16 1. PUT SOMETHING LIKE THIS IN YOUR APACHE CONFIG:
17 <VirtualHost *:80>
18 AliasMatch ^/site/\w+/(.*) /var/www/drupal/$1
19 DocumentRoot /var/www/drupal/
20 </VirtualHost>
21 WARNING:CLEAN URLS demand a much more complicated setup with a bunch of rewrite rules.
22 See the Appendix in this file for details
23
24 2. PUT SOMETHING LIKE THIS IN YOUR ./sites/default/settings.php
25 or better at ./sites/www.example.com.site/settings.php
26 ----CODE BEGIN-----
27 $requri = explode('/', request_uri());
28 if (sizeof($requri) >1 && $requri[1]=='site' && $requri[2] != '') {
29 $my_site_base = $requri[2];
30 #this will be the database shared between the main site and the shared sites
31 $db_url = 'mysql://username:password@localhost/database';
32 $db_prefix = $my_site_base."_";
33 $base_url = "http://www.example.com/site/$my_site_base"; // NO trailing slash!
34 }
35 ----CODE END-------
36
37 3. Any modules required for profile selections must be installed on
38 BOTH the main site's modules directory AND the subsidiary site module
39 directory (a symlink will do just fine);
40 the former in order to install, the latter in order to run.
41
42 APPENDIX:
43 =========
44 How to get CLEAN URLS working with apache and multisite setup:
45 It's gross! I told you so!!!!!
46
47 <VirtualHost *:80>
48 DocumentRoot /usr/local/share/sandboxes/common/drupal/drupal/
49 # Welcome to the Ugliest Rewrite Rules Evar(tm)!
50 # Here's the jist:
51 # 1. AliasMatch will set the file context without passing a different URL to Drupal
52 # Therefore index.php must be matched outside of Rewrite rules
53 # 2. Rewrite is used ONLY to forward URLs of the form /xxx -> index.php?q=/xxx
54 #
55 # If we took Rewrite rules outside of the Location contexts so its in per-server
56 # processing, we might be able to simplify this. We would need option 'PT' for
57 # passthrough and then some AliasMatch record AFTER the rewrite rules.
58
59 # If you figure it out, then go for it. Otherwise, what ain't broken...
60 AliasMatch ^/site/\w+/(\w+).php /var/www/drupal/$1.php
61 AliasMatch ^/site/\w+/(modules|misc|files|themes|sites)/(.*)$ /var/www/drupal/$1/$2
62
63 <Location />
64 RewriteEngine on
65 RewriteCond %{REQUEST_FILENAME} !-f
66 RewriteCond %{REQUEST_FILENAME} !-d
67 RewriteRule ^var/www/drupal(.*)$ index.php?q=$1 [L,QSA]
68 </Location>
69 <Location /site>
70 RewriteEngine on
71 RewriteCond %{REQUEST_URI} ^/site/
72 RewriteCond %{REQUEST_URI} !index.php
73 RewriteCond %{REQUEST_FILENAME} !-f
74 RewriteCond %{REQUEST_FILENAME} !-d
75 RewriteRule ^/var/www/drupal/site/(\w+)(/)?(.*)$ http://www.example.com/site/$1/index.php?q=$3 [L,QSA]
76 </Location>
77
78 </VirtualHost>
79
80 ALTERNATE for HTACCESS File
81 =========
82 This is an in-development configuration that works through only rewrites in a
83 local .htaccess file
84 1. create a symlink called 'site' to drupal's home directory, like this:
85 % cd /var/www/drupal
86 % ln -s . site
87 2. Add the following to the top of the .htaccess file in the drupal directory
88 RewriteEngine on
89
90 #file access
91 RewriteRule ^\w+/(modules|misc|files|themes|sites)(.*)$ ./$1$2 [L]
92
93 RewriteRule ^/(modules|misc|files|themes|sites)(.*)$ ./$1$2 [L]
94
95 #special php scripts
96 RewriteRule ^\w+/(update.php|install.php|index.php)(.*)$ ./$1$2 [L,QSA]
97
98 #site sub-section
99 RewriteCond %{REQUEST_FILENAME} ^/var/www/drupal/site/.*
100 RewriteCond %{REQUEST_FILENAME} !-f
101 RewriteCond %{REQUEST_FILENAME} !-d
102 RewriteRule ^\w+(/)?(.*)$ index.php?q=$2 [L,QSA]
103
104 #### clean url stuff should be further down in default file

  ViewVC Help
Powered by ViewVC 1.1.2