[documentation] multisite same codebase, different everything else rough draft

Anisa mystavash at animecards.org
Mon Jun 26 14:19:37 UTC 2006


I posted a VERY rough draft here http://drupal.org/node/70861

Text copied below.
PROBLEMS: Assumes that the user already has a main site installed.  Needs
separate instructions for pgsql.  Some formatting issues.  Sorta half
between too detailed and brief.  Maybe separated into basic and very
detailed would be good...  some people may appreciate knowing the whys and
wherefores, but some don't want to dig through all that.

Good points: runs through examples of 3 basic alternate sub sites, sub
domains, sub folders, and a completely separate domain.

---------------------------------------

This document assumes the following:

   - You want to create more than one Drupal site using the same codebase
   (the same basic set of Drupal files, uploaded into one location).
   - You know how to install mysql tables in your database.
   - You know how to set up subdomains/folders/other domains that you
   want to use.
   - You have already downloaded Drupal 4.7, and set up one MAIN site.

This document contains instructions on how to create completely separate
Drupal
site, with different configurations, users and content. Nothing is shared
between
the installations except the codebase.

Some definitions:

*codebase:* the basic set of Drupal files, included in the .tar.gz
file. the stuff that makes Drupal work.

*database:* a collection of *tables* that stores data.

Affected files:

settings.php (sites/default/...)

database.mysql

For this example, we will assume the following:

www.example.com: <http://www.example.com/> the MAIN site, where the codebase
has already been uploaded,
and settings.php has been properly configured.

sub1.example.com; www.example.com/sub2; www.subexample.com : the other sites
we will create.

1. Create the following folders in your sites directory:

sites/sub1.example.com/

sites/www.example.com.sub2/

sites/www.sub3example.com/

Copy the settings.php file from sites/default into each of the above
folders.

2. There are different database files (inside the database folder). Select
the one that is appropriate for your database version. Copy it to each of
the
folders you made in step 1. This is OPTIONAL, but it will help you keep
things
straight.

3. Decide on SEPARATE PREFIXES for each site. Below is what we will use for
the example:

*site*
*database prefix*

sub1.example.com
sub1_

www.example.com,sub2
sub2_

www.sub3example.com
sub3_

4. Configure your settings.php for each site.

This code MUST BE CHANGED FOR EACH SITE:

 $db_url = 'mysql://username:password@localhost/databasename';

Note; if you are using the same database as the MAIN site, the $db_url is
the
same.

OPTIONAL:

# $base_url = 'http://www.example.com'; // NO trailing slash!

   # $conf = array(
  # 'site_name' => 'My Drupal site',
  # 'theme_default' => 'pushbutton',
  # 'anonymous' => 'Visitor'
  # );


For sub1.example.com, the settings would be:
$db_prefix = 'sub1_';

$base_url = 'http://sub1.example.com';

$conf = array(
  'site_name' => 'My SUB1 Drupal Site',
  'theme_default' => 'pushbutton',
  'anonymous' => 'Visitor'
  );

For www.example.com/sub2, the settings would be:
$db_prefix = 'sub2_';

$base_url = 'http://www.example.com/sub2';

$conf = array(
  'site_name' => 'My SUB2 Drupal Site',
  'theme_default' => 'fancy',
  'anonymous' => 'Anonymous'
  );

For www.sub3example.com, the settings would be:
$db_prefix = 'sub3_';

$base_url = 'http://www.sub3example.com';

$conf = array(
  'site_name' => 'My SUB3 Drupal Site',
  'theme_default' => 'marvin',
  'anonymous' => 'Guests'
  );

6. Upload the modified settings.php files in their respective folders.

7. Open the database file you copied into each sites folder. Find the
following (*don't forget the SPACE at the end!!!*):

CREATE TABLE
INSERT INTO

Replace each 'create table' and 'insert into' with 'create table dbprefix_'
and 'insert into dbprefix_'

For sub1.example.com:

CREATE TABLE >> CREATE TABLE sub1_
INSERT INTO >> INSERT INTO sub1_

8. Upload the modified mysql files into the database you specified in your
settings.php.
9. Voila!
---------------------------------------

Let me know what you think!  The style for this can be the basis for the
other two basic configurations.

Anisa.

-- 
*********************************
www.AnimeCards.Org

16,000 scans and counting!
*********************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/documentation/attachments/20060626/141c5906/attachment.htm


More information about the documentation mailing list