I have a confession to make – Drupal multisite had been quite a mystery to me!
I failed to really grasped the concept, at least until recently.
Up to now, I have been building perhaps more than 30 sites and my favorite platforms were mainly Drupal and WordPress. I also moved my webhosting four times and doing new installations on a new server has taught a lesson or two. Thankfully, by time and lots of playing around with cPanel, installing, de-installing and so on, has put my understanding of the whole thing to a new level than when I first started.
It seems that the answer to my old puzzle lies in correctly using cPanel’s “Addon Domain” feature. Some techies advised against using cPanel but I am completely happy with it as it posed no problem up until now. The best part is – it’s easy and it works and suits almost everyone!
During my struggle, I looked at every other places and most will tell you to do something with .htaccess file and symlinks. I didn’t find fiddling with those stuff amusing. If one or both of these sounds Greek to you too, then worry not as I have discovered an absolutely simpler solution which I’ll share now.
In short, here’s what I did in a few steps:
Just repeat steps 3 to 5 above for as many sites as you have.
As you can see, all domain URLs will end up at the same place i.e. “public_html/drupal”. However Drupal can tell the actual folder by looking at the URL entered and compare with domain name(s) defined in “drupal/sites/<domain name>” folder. So each URL will go to its’ own folder to do whatever it was supposed to do.
Setting up sub-domain as part of a multisite configuration is no different than that of the top level domain. I described a similar process in this post.
You may choose to use a common database shared across all your Drupal sites or otherwise - but that is another topic altogether.
As for myself, I only maintain a single set of Drupal codes for all of my Drupal sites. This makes my life a lot easier especially when it’s time to do updates, upgrades or even moving webhost.
On a different topic, I also run my WordPress sites using a single WP codes too. I shared how I did it in another article here. So I am like having two control centers where I manage all my Drupal and WP sites no matter how many of them. Adding a few more as I go along is a breeze. Life can’t be better than that, or can it?
Hope this helps you or someone out there. Enjoy.
1. Stephen On Drupal: How to Correctly Set up Drupal Multisite?
2. Getting Started with Drupal: A Comprehensive Hands-On Guide
1 comment
Dear obwan This is the best
Submitted by Dr. Tejbir Singh (not verified) on Sun, 04/11/2010 - 02:48