How can i setup database and source code of single domain to be used by multiple domain in drupal?

92 views Asked by At

I have a used domain access module (Drupal 7) for creating a website. My requirement is, there will be one main site and many sub websites in the same domain. all the sub websites will access the same database and the source code of main website. All this websites will be in a VPS hosting. One Main website and all other sub websites are sub-domains, created. For Example:

enter code here example.com  -- Main website.
one.example.com -- sub website.
two.example.com -- sub website. 
three.example.com -- sub website.

Now, the scenario is, the database and the source are in example.com. Can I have a sub-website as another domain like apple.com, orange.com -- sub-websites

Is this possible? and in which server I have to place my database and code.

1

There are 1 answers

0
mjp On

Do you need to share content between the various sites? If so, you'll probably want to use Drupal's Domain Access module (as you've tagged this question). However, if these are all going to be distinct sites that do not have to share content (except maybe through Aggregation or Feeds) - you can avoid that module.

I'm pretty sure the approach you want to take is documented here: https://drupal.org/node/2622 - basically, you use one database, but each site uses its own table prefix to distinguish it from the other sites.

As far as running multiple sites from one Drupal root, you can use the built-in multisite support: https://drupal.org/documentation/install/multi-site . I don't think you will need drupal domain access at all in this case.