Drupal, Mulitsite, CVS
Sunday, March 1st, 2009Drupal has a multisite feature that allows you to run multiple sites under the same code base. I found a great tutorial here which uses CVS to install Drupal. The advantage of using CVS is that if you want to update/upgrade your Drupal install, it’s as easy as issuing a single command in your shell.
First I setup my Dreamhost UNIX directory structure by following this wiki entry. The wiki entry goes into a lot more detail but the important part is to keep your directory structure clean and put all of your websites under ~/www.
Then I followed the instructions from the above mentioned tutorial.
Here are some highlights…
Checkout Drupal verision 6.10 from the CVS repository, by using the tag DRUPAL-6-10, to your directory…here it’s ~/www (here is a list of valid tags):
$ cd ~/www
$ sudo cvs -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout -r DRUPAL-6-10 -d drupal drupal
This will create a directory called ‘drupal’ and place all the checked out files in that directory. Create all the other directories following the tutorial..including one for each domain you want to host.
Since, I don’t have access to my web server’s configuration files, I used Dreamhost’s control panel to point the two domains to the drupal install directory (if you’re on Dreamhost, you can find it under Manage Domains…click on the Edit button under Web Hosting for the domains you want to run on Drupal).
You can also checkout contrib modules using CVS. Here’s an example of how to grab the admin_menu module. To find the tag to use for the version(-r) parameter, here it’s DRUPAL-6--1-3, click on the Release Notes link that accompanies each release. At the top of the page you should see the tag in all caps.
$ cd ~/www/drupal/sites/all/modules/drupal-contrib
$ cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -r DRUPAL-6--1-3 -d admin_menu contributions/modules/admin_menu
Later, to update your core and contrib modules, you just have to run this (of course, make sure you backup stuff, turn off modules, etc. before updating. Basically follow appropriate upgrade instructions):
$ cvs -nq update -dP
