Drupal: Multi-site and Signing-in once
With Drupal a developer has many different choices in order to help him create a multi-site installation.
First of all, we should clarify what needs we have. We might need different modules in each site, but we might, also, need different themes, different names and nothing else. We might need to create affiliate sites with one common sign-in. All this can be done with drupal.
The drupal way (without using any modules) is to create different folders under the
Under
If we create subdomains, and not different domains, if we want to allow users to sign-in once for all subdomains, we must set the
Another way to create something like above, is to use the module DomainAccess. It comes with many other modules and has the ability to associate the
For example, let's say we want to create
Another possibility is that we have different webservers, with different drupal installations, associated with different domains, installed in different databases, using the same database server(ex. 192.xxx.x.1 and MySQL). Even in this case, a user can sign-in only once to all sites. Using the SingleSignOn module including the
What will be used for each project is something totally chosen by the developer. The table below tries to simplify things a bit:
First of all, we should clarify what needs we have. We might need different modules in each site, but we might, also, need different themes, different names and nothing else. We might need to create affiliate sites with one common sign-in. All this can be done with drupal.
The drupal way (without using any modules) is to create different folders under the
sites
folder. The installation already contains sites/all
and sites/default
. By creating folders below:
1. sites/all/modules 2. sites/all/themes 3. sites/default/modules 4. sites/default/themes 5. sites/example 6. sites/example/modules 7. sites/example/themeswe allow drupal to associate different (sub)domains with the same installation but with different modules and enabled.
Under
sites/all/modules
and sites/all/themes
are placed the modules and themes that will be available to all (sub)domains. In contrary, under sites/default/modules
and sites/default/themes
drupal recognises modules and themes available for installation only in default
installation. The same goes for example
as well.If we create subdomains, and not different domains, if we want to allow users to sign-in once for all subdomains, we must set the
$cookie_domain
variable in settings.php
to .example.com
. Be careful at the first dot!
Another way to create something like above, is to use the module DomainAccess. It comes with many other modules and has the ability to associate the
sites/default
folder to different (sub)domain names. All it does is create different tables for each (sub)domain in the same database whenever the administrator chooses.For example, let's say we want to create
www.example.com
and sub.example.com
. We want both to have their content available to both sites but the permissions for each site to be different. All we have to do is copy the permissions
table from the primary site www.example.com
for sub.example.com
to find it. And this is done of course from the modules' drupal administration page. No programming skills required.Another possibility is that we have different webservers, with different drupal installations, associated with different domains, installed in different databases, using the same database server(ex. 192.xxx.x.1 and MySQL). Even in this case, a user can sign-in only once to all sites. Using the SingleSignOn module including the
SSO controller
and SSO client
modules. This module can be used even with different domains. It needs a primary domain to be set, like DomainAccess does, but the session id stored in database by the controller domain, is recognised by all client domains.What will be used for each project is something totally chosen by the developer. The table below tries to simplify things a bit:
Users sign-in once for all sites | Users sign-in for every different site | |
---|---|---|
Domain with one or more subdomain(s)
(only one drupal installation) or (only one webserver installation) |
|
|
Domain with one or more subdomain(s)
(many drupal installations) |
|
|
One or more domains with zero or more subdomains
(only one drupal installation) or (only one webserver installation) |
|
|
One or more domains with zero or more subdomains
(many webservers) and/or (many drupal installations) |
|
|
One or more domains with zero or more subdomains
(many webservers) and/or (many drupal installations) |
- | - |
Comments