This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

📣 Try the fastest hosting platform with pay-as-you-go pricing & 24/7 expert support! MIGRATE NOW →

How to Setup Drupal Multisite Easily

Updated on November 15, 2017

2 Min Read

Drupal is an incredible CMS that has a lot of extremely useful features. I’ve written about many of them in my previous blog posts. In this post, however, I’ll be focusing on a relatively new feature that could prove to be very useful for many people- Drupal multisite. Popular CMS such as WordPress already offer this functionality to their users. It is important for Drupal developer to know how to setup Drupal Multisite for your projects.

How-to-Setup-Drupal-Multisite-

Who Needs It?

Multisite is a feature that allows you to set up multiple websites with the same code base. All these sites will contain the same core, themes, and modules. Possible scenarios that could benefit from Drupal multisite could be:

  • If you have several sites that are all similar in functionality. In this situation, multisite is a great solution for easier management of all the websites.
  • If you need multiple sites with the same core, modules, themes or distribution.
  • If you have limited resources and/or limited workforce and a lot of sites to manage.

Install and Setup Drupal Multisite

Installing and setting up multisite isn’t as simple as other Drupal features, however, the following instructions should have the multisite feature up and running perfectly. Let’s dive into setting up a new site with a shared code database:

  1. First, create a new database for your site. You can also use database prefixes for this purpose.
  2. Next, you will need to create a new subdirectory in the sites folder. Note that the settings.php config file for this site will be located inside this new subdirectory i.e. sites/multisite.com/settings.php. So your site ‘www.multisite.com’ will be housed in the sites/multisite.com directory. Also, note that in order to run your multisite off subdomains, you should name your directory like this: subdomain.example.com.
  3. Now copy the default.settings.php file from sites/default/ directory and copy it to your new site’s directory, renaming it to settings.php.
  4. Before proceeding to install the site, you will have to change the permission of the settings.php file(copied earlier) to be writeable. Since there is a chance that moving the file to another subdirectory could change the permissions, it is a good idea to manually change the permissions to 644 [-rw-r–r—]. If you skip this step, there is a real chance that the installation will fail.
  5. If you are running your subsites off a subdomain, you most likely won’t encounter any errors. However, if you are running off subdirectory you might encounter an error. In order to circumnavigate this error, you have to create a symbolic link to your sites. In order to do this, simply navigate to your site’s directory and type the following command: ln -s . site 1.
  6. Go to your website and navigate to your site’s URL to install the site just like a normal Drupal installation.

Conclusion

That’s it! You now how to setup Drupal multisites. Say goodbye to having to set up similar sites from scratch and say hello to this awesome feature! After all, time is money and when you save time, you save money. If you liked this blog post, then you should definitely read another blog post by us on, Embedding Videos On Drupal 8 Websites.

Share your opinion in the comment section. COMMENT NOW

Share This Article

Hamza Zia

Hamza is a Drupal Community Manager at Cloudways - A Managed Drupal Hosting Platform. He loves to write about Drupal and related topics. During his free time, he can be seen obsessing over Football, Cars, Android and Gaming.

×

Get Our Newsletter
Be the first to get the latest updates and tutorials.

Thankyou for Subscribing Us!

×

Webinar: How to Get 100% Scores on Core Web Vitals

Join Joe Williams & Aleksandar Savkovic on 29th of March, 2021.

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Want to Experience the Cloudways Platform in Its Full Glory?

Take a FREE guided tour of Cloudways and see for yourself how easily you can manage your server & apps on the leading cloud-hosting platform.

Start my tour

CYBER WEEK SAVINGS

  • 0

    Days

  • 0

    Hours

  • 0

    Mints

  • 0

    Sec

GET OFFER

For 4 Months &
40 Free Migrations

For 4 Months &
40 Free Migrations

Upgrade Now