Setting up the Drupal multisite on bcim.lsbu.ac.uk

Fri 15th August, 2008.


Inch by inch, working closely with Tom in ICT, we finally managed to get the BCIM VM set up with a Drupal (v6.4) multisite installed as required. After several failed attempts, it turns out that the steps required to successfully create the multisite are as follows. (I realise that I'm using the term microsite rather too loosely here to denote a lower-level site.)


(1) Decide on the URLs for the sites we want to start off with (we can define alias URLs and add more sites later)...

bcim.lsbu.ac.uk  (for the main Faculty website); 

bcim.lsbu.ac.uk\icr  (Institute of Computing Research microsite); 

bcim.lsbu.ac.uk\staffweb  (staff intranet microsite);

bcim.lsbu.ac.uk\sandbox  (for experimentation now and in the future).


(2) Install Drupal within the root html directory, with an associated MySQL database.


(3) Create a new MySQL database for each microsite.


(4) In the sites/default directory...

...duplicate default.settings.php and call it settings.php

...set the $db_url variable as appropriate in settings.php

...create a sites/default/files subdirectory


(5) Create a duplicate of the sites/default directory for each microsite...

sites/bcim.lsbu.ac.uk.bcim.icr;

sites/bcim.lsbu.ac.uk.bcim.staffweb;

sites/bcim.lsbu.ac.uk.bcim.sandbox

...and set the $db_url variable as appropriate in the settings.php file for each microsite,

...and set the $base_url variable for each microsite equal to the url of the microsite rather than the url of the Drupal installation as indicated in the installtion instructions!


(6) Create a symbolic link for each microsite by invoking this run_once_only___create_symlinks.php script (placed in the root html directory) from a web browser.


(7) Navigate to the main site...

http://bcim.lsbu.ac.uk/

...and run the installation script:

http://bcim.lsbu.ac.uk/install.php


(8) Navigate to each microsite...

http://bcim.lsbu.ac.uk/microsite/

...and run the installation script:

http://bcim.lsbu.ac.uk/microsite/install.php


(9) Configure each site and add pages as necessary, putting each site's custom theme into...

sites/bcim.lsbu.ac.uk.microsite/themes/microsite


(10) Getting clean URLs to work for all the sites was a tough one, but thanks to this...

http://drupal.org/node/25011#comment-136227

...I got it working by adding the following line to the .htaccess file within the root html directory...

RewriteBase /bcim 

...followed immediately by a compound conditional rewrite for each microsite - e.g. for the icr microsite:

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_URI} ^/bcim/icr/(.*)$

RewriteRule ^(.*)$ /bcim/icr/index.php?q=$1 [L,QSA]



Thanks a lot for your help, Tom!