Skip to main content
  • About
  • Services
  • Blog
  • Contact
A drupal website with a blog about SEO, Linux, PHP, and funny nerd stuff
Home » Blogs » chuck1's blog

Drupal Multisite Tip - Compartmentalize

Submitted by chuck1 on Mon, 2009-05-11 16:41

Drupal makes it easy to keep it simple

What hassle! File this one in the "Don't make the same mistakes I made" folder.

One (of many, IMHO) things that sets Drupal head and shoulders above other content management systems is the ease with which one Drupal code base can run multiple domains. The down side of this is that when something gets borked in your configuration, it can affect all of your sites. At that point, you might dedicate several frustrating days to deciphering error messages and slogging through tens of thousands of lines of code to unwind the mess.

Based on experience running six sites on separate domains from one Drupal installation, I want to share one bit of advice with Drupal admins, especially those configuring a fresh multisite:

For the love of Gawd, compartmentalize!

What do I mean by this? The directory structure for a multisite, as you should know, looks like this:

/sites
./all
../modules
../themes
./site1.com
../modules
../themes
./site2.com
../modules
../themes

etc.

It looks like that for darn good reason.

If you're an idiot (like me) you might be tempted to put most of your themes and modules in the "all" directory because, hey, you never know when you might want to add some feature or look to whatever site. DO NOT DO THIS!!! It will cause you untold pain down the road. Trust me.

If site1.com is a social networking site, you might want to install the Friend module (though I would recommend Buddylist instead). Install it in /site1.com's modules directory, not /all/modules. That way, if Buddylist conflicts with some other module, it will only affect site1.com. Compartmentalization also minimizes the chances of such conflicts occurring in the first place. Fewer modules on a given site ---> fewer chances for conflict. Make sense?

The same applies to themes. Less is more. A stitch in time saves nine. All that.

Set things up correctly from the word go. If you configure your multisite like I did, with too many modules and themes available to all sites, any solution to performance issues will be a hack. What I discovered was that once you install a module in the /all folder, it is well nigh impossible (or at least a major hassle) to move it to the individual site's directory. You end up having to back up that module's database tables, re-build and re-install the module, and import the data into the tables. Even that doesn't work sometimes, and even if it does, you'll have to repeat the tedious process many times to sort everything out.

So think about what you really need for a given site, not what you think you might want down the road. Install contributed modules and themes site-by-site. Take advantage of Drupal's elegant multisite configuration and compartmentalize.

Share this
  • Drupal
  • chuck1's blog

I currently have two e-books published and available from Amazon.com. Never mind the cheesy do-it-yourself cover art -- you need to read these.

How to Make Money as an Internet Publisher
Find out if you have what it takes to make the Internet spit money at you. It's not easy. It's not something anyone can do. If you do have what it takes, this book will show you the way. If you don't, you're better off finding out now.

We Are Water (plus a few songs for dolphins)
A priceless poetry chapbook sure to make your day. Only $2.99!

Popular content

Today's:

  • Auto Blog Samurai - Get Rich Quick Polluting the Internet
  • Secure PHP: Sanitize form input to protect against XSS

All time:

  • Moving a Drupal site to a new domain or subdomain
  • Demystifying the Weighted Mean
  • Protect Against XSS Attacks

Last viewed:

  • How to SEO a Flash Website
  • Businesses Spend More Ad $$ Online than in Print
  • Secure PHP: Sanitize form input to protect against XSS
  • Demystifying the Weighted Mean
  • I sure am proud to be an American
Copyrights to all content in the domain http://chucklinart.com are owned by the users who posted. All opinions are owned by the users who posted them and do not necessarily reflect those of the site's operators. The site itself is Copyright © 2006-2011, Charles Linart