This blog is in continuation of our series on Drupal. To Know more about Software Associates' competence on Drupal, services offered and to brush up your basics, please refer to our previous blog Drupal – Content Management made easy . We have deployed Drupal content management systems for our clients across the world with excellent results and continue to provide support and updates on new development.
In this blog we will talk about steps to set up Multiple sites using Drupal
To begin with setting up multiple sites in a single Drupal installation is pretty straightforward. The main concept of multi-site is to share core files, modules, themes etc.
We can run multiple domains on one Drupal installation, thus it is very easy to manage and maintain the source code. The intended location for all non-core elements of a Drupal installation is in a separate /sites directory inside the Drupal installation. The following is the directory structure:

All sub directories in sites folder should contain a site-specific settings.php file. Configure Drupal site settings to specify 'File System Directory' of 'sites/first-site.com/files' instead of the default 'files'. It's possible to do this with an existing web site, but moving file uploads around can cause a lot of confusion if there are already URLs pointing to the old locations.
Domain specific modules and themes should also be placed in sites/first-site.com/modules and /sites/first-site.com/themes respectively.
Contributed modules and additional themes which are for use by all domains in a multi-site installation should be placed in /sites/all/modules and /sites/all/themes. Note that there shouldn't be a /sites/all/files or /sites/all/settings.php.
The /sites/default directory should contain/files and settings.php,for use if the /sites/first-site.com directory doesn't exist for a domain.
Once you've done this, the file structure of your site will be cleanly organized:
- The main Drupal directory will contain only the standard 'core' files.
- Themes and modules that are shared among all sites are properly placed in /sites/all
- Site-specific themes, modules, and files are compartmentalized and properly placed in /sites/first-site.com, /sites/sub3.second-site.com and /sites/sub3.second-site.com.site4 .
/sites/default/settings.php and /sites/default/files will be used if /sites/first-site.com directory does not exist.
- Backing up the /sites directory and your Drupal database will give you everything you need to restore the site in the event of a crash, or to move to a new server.
- Adding a domain is easy: just copy the /sites/default directory to /sites/example5.com
To help keep files organized you may choose to use shortcuts to point relevant files and directories that are stored elsewhere in your Drupal installation. These short-cuts (like a desktop "alias") are referred to as "symbolic links" on a Web server. Symbolic links can be used for several purposes:
- Even if using default settings, a good option is to use links from /sites/first-site.com directory to point to the /sites/default directory. That way, if the settings and /files are ever changed from the default and actually placed in /sites/mysite.com, their location does not 'move' and no links are broken.
- Links could also be used to point the /sites/default directory to your primary site.
- A /files directory could easily be shared across two domains without being shared across the remaining domains.
- A non-domain-name path for /files can be setup. If it is possible that the domain name might change (say, from a development name), then you can set up a link from /drupal/sites/moniker to /drupal/sites/first-site.com, where 'moniker' is a short version of the site name that will remain constant even if /first-site.com changes.
For more details refer to www.drupal.org
- By CMS Team , Software Associates
Our drupal competency
Related Posts
- No related posts found




