0

I have just started to learn Drupal. So, I apologize to ask such a silly question here.

I wanted to create multi sites in Drupal. I have unlimited access to create Subdomains, Parked Domains, Addon Domains, Email Accounts and All SQl Databases with my hosting provider.

I wanted to create total 4 websites.

  • One that I have already created just to play and learn drupal with just Basic Structure and layout.

Rest of the three websites should have same layout and theme but different layout and theme then what I have already created called Basic Structure.

So, theses three purposes should have Same Theme and Same layout with Different Databses with Same User Names and Password.

  • One for Development purposes,
  • One for Staging purpose and
  • One for Clients Editing purpose (where client can play with our mock-up website for their content editing purpose).

I have read lots of reviews and steps to create multi sites in Drupal. Everyone explained it nicely in different ways. And I tried all the different ways to make it work. So, by trying and doing all those, I have messed up everything.

So, now I wanted to create again from beginning. Can anyone help me with that? Can any one provide steps to how to create multi site in Drupal? I am just beginner for Drupal. So, can anyone please explain the steps in detail?

Also, What is the best practice to create multi sites? With Parked Domain or with Sub Domain?

Thanks for your help!

1 Answer 1

0

If the only purpose is to have a a dev/test/live environment, you should just go with a service like Pantheon which provides all of those for you with an ease of maintenance.

If you want to host it yourself, here's the gist of what you do...

  1. Make sure you only have one Drupal root. Can't stress this enough. If possible, also be on version control (git) as this will help immensely.
  2. Create 4 separate MySQL databases. Would go with a naming convention of like CODE_dev, CODE_test, etc.
  3. Inside of your sites directory, create 4 directories, each with their own settings.php and files directory. You can name them whatever, just keep it consistent for ease of use. ie, dev.example, test.example, etc. Add their database credentials to their settings file.
  4. In your sites directory, you will create a file called sites.php. In there, you will assign a directory name to a URL. So if you used dev.example as the name of your development site directory, and your subdirectory URL looks like dev.example.com, the format will look like this:

    $sites['dev.example.com'] = 'dev.example';

    Do that for each directory/site.

  5. In your registrar for your DNS settings, point all of the subdirectories to the same IP or path as the top level domain (example.com), which should be the Drupal root directory. From there, Drupal will take care of the rest.

I think that's it, but anyone feel free to correct me. As far as the themes go, put it in sites/all/themes so all sites will have access to them. If you want a site to only have access to a specific theme/module, put it in THAT site folder.

For example: sites/dev.example/themes/THEMENAME

4
  • Thank you so much KyleTaylored for all step by step information. I have followed all your steps. But, I don't understand last step no. 5. So, can you please elaborate step-5 more? I am going to set up this for the first time. So, I don't know how to set DNS. I tried though but I guess I did it wrong way so it gives me "This webpage is not available". Thank you so much for all this help.
    – Vidushi
    Commented Jul 25, 2014 at 13:59
  • I probably should have asked what your hosting is like, because really you could do this through cPanel if you have it available. Basically you just want all of the subdomains to point to the root directory where Drupal is installed. Make sense? Confirm that the top level domain is working first. Commented Jul 25, 2014 at 14:34
  • THANKS for your prompt response and your help. Yes, I have access in cPanel. But, in cPanel where should I set up all this? There are Simple DNS Zone Editor, Advanced DNS Zone Editor, SubDomains, Parked Domains, Redirects options. And I have unlimited access to create anything. But, I don't know where, what and how should I set? Do I need to create Subdomain? Or do I need to go to Simple DNS Zone Editor? Or anything else? I tried to play with Simple DNS Zone Editor and subdomain but it gives me Internal Server Error.
    – Vidushi
    Commented Jul 25, 2014 at 14:49
  • I would reset your DNS settings to default, and then you can create subdomains that point to the root folder. Commented Jul 25, 2014 at 21:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.