Case Study: How To Setup Multisite Configuration on Drupal
One of the feature of Drupal Content Management Framework, you can set multi site with a single code base without a massive modification on scripts code. We just set up some configurations on Apache Web Server (I assume you use this great web server software) and some configuration on Drupal settings (yes, Drupal has provided this multisite configuration out of the box).
If you unpacked the Drupal package, you may find on settings.php comment how to set up multisite. From my experience, I have read many posts but I have to tear my hair off to get it done. From this documentation, it makes sense, and I want to start from there.
Okey, I have case study to share with you. I have set up multisite with different subfolder. Yes, you may apply this for subdomain too. First I will describe how to set up multisite with sub folder: http://playwithbeauty-id.com/magicspell, and http://playwithbeauty-id.com/whiteglam.
You have to have some knowledge about:
- Edit Apache configuration and reload the web server
- Edit Drupal configuration ;). I bet you know this one.
First we edit apache configuration. Configuration path depends on your installation and operating system, find httpd.conf or apache.conf then add this line:
Alias /magicspell /PATH_TO_YOUR_PUBLIC_HTML/
Alias /whiteglam /PATH_TO_YOUR_PUBLIC_HTML/
You may change magicspell and whiteglam with your own sub folder. The second step is create multisite folder on Drupal root folder:
mkdir -p sites/playwithbeauty-id.com.magicspell/{files,themes}
mkdir -p sites/playwithbeauty-id.com.whiteglam/{files,themes}
Commands above create two multisite with files and themes folder. We create separate files and themes folder to make a different theme with the main site. Now copy settings.php file from the default configuration to those folders:
cp sites/default/settings.php sites/playwithbeauty-id.com.magicspell/
cp sites/default/settings.php sites/playwithbeauty-id.com.whiteglam/
Edit those settings.php with different database configuration to make them properly separated. Also you can set $base_url variable to reflect the website URL (recommended).
Okey, reload the apache configuration:
apachectl graceful
Then try to access those subfolder URL. If you find an installation page, then you are done! Follow the instruction and create a custom theme for your new subfolder by copying your theme on sites/YOUR_DOMAIN.subfolder/themes. Good Luck!