Skype: theneemtreegroup
Phone: (Australian callers) 02-8003-4624
(international callers) +61-2-8003-4624
Email: http://neemtree.com.au/contact
Sharing content, users, and configurations across multiple Drupal sites
XAMPP has proven useful in creating multiple, uniquely named, sites on a local sandbox server. The primary motivation for this was to play with Drupal's Domain Access module. This module allows a single instance of Drupal to share content, users, and other configurations across multiple Drupal sites.
To start with, I edited C:\xampplite\apache\conf\extra\httpd-vhosts.conf and C:\WINDOWS\system32\drivers\etc\hosts to create the following domain names:
Only http://ignitesport.six is mapped to a Drupal installed, the other domains will be set up using the Domain Access module installed on http://ignitesport.six.

(Don't worry about the settings_*.inc files for now, we'll cover those later.)
1. Install the Domain Access module
Install Domain Access 6.x-1.2 by unzipping it into your modules folder. This provides a number of modules, all of which are dependent on the main Domain Access module. Installing this allows you to add domains:
The documentation can be found in a number of README.txt files. These will instruct you on how to edit your settings.php to use Domain Access. After installing Domain Access, I copied modules/domain/settings_custom_url.inc to sites/default, and appended the following to the end of sites/default/settings.php:
require_once 'settings_custom_url.inc';
2. Add the domains to be managed by Domain Access
Browse to the newly added domains (e.g. http://ignitegolf.six) which should be a fresh Drupal install.
3. Install Domain Access' Domain Prefix and Domain Themes modules
Installing these additional modules provides the functionality to share users, content, and themes across multiple sites. After enabling Domain Prefix and Domain Themes on http://ignitesport.six/admin/build/modules, I copied modules/domain/domain_prefix/settings_domain_prefix.inc into sites/default, and appended another line to the end of settings.php:
require_once 'settings_domain_prefix.inc';
4. This provides a few more configuration options on the Domain Access admin pages

Navigate to admin --> domain access --> table prefixing and leave everything to Igore, except for Node and Users, which should be set to Copy. This allows for users and content to be shared across the domains.
Update the users (admin --> user management --> users) and edit the users you would like to provide Domain access settings to.
Also, create or update nodes that you would like to share across domains:
Themes' settings can be applied from within Domain Access (admin --> domain access --> batch updating --> theme settings):
Browsing to the 'affiliate' domains now demonstrates individual Drupal sites, with their own themes, shared users, and shared content:


















Comments
Can I customized each and every codes? I like learning this. Thanks fro sharing.
landscape photography
great tut, have been looking for that for a long time tree removal cost
Everything I have set up for the first site looks good on my installation, but in the second site, it's not showing the page node I created from the first site. Any ideas why this might be?
When I created the node, I made sure to select both sites in the dropdown list.
thanks
Very helpful site!!
However, I'm hitting a brick wall when I'm creating a story or a page. When I publish to a specified affiliate, it ended up publishing to all affiliates. I even made sure "Send to all affiliates" is unchecked. Have you seen this issue?
Thanks!
My only guess is that you need to select 'send to all affiliates' & the domain you want to send it to. It seems the instructions are misleading (not sure if they've changed since I blogged this).
From http://drupal.org/node/320909, README should say:
dude, m not sure u have found out the solution or not. But rebuilding the content permissions was the key for my case. It shows warning on top of the page to rebuild the content permission and that was it.
Hope it helps!
Cheers Rohit!
I'm assuming you're referring to "2. Add the domains to be managed by Domain Access". From memory, I was able to successfully use subdomains for that configuration. If you're receiving an error message, submit an issue for the module developer with the details.
Post new comment