I have eleven (11) sites that will go Drupal for sure in the next couple weeks. I got to thinking how much work I might save myself if I used a Multi-site arrangement. Installation, updating and keeping all those sites... plus those planned will take a great deal of admin work. One thing I was excited about using Drupal was multi-site, but I'm not exactly clear on how it would work.

I've searched abit and read some, but my first priority was to determine if Drupal was a good fit for my existing sites.

I'm not too sure exactly how the multi-site works, but lazy me is thinking of one basic core installation of modules. A separate MySql database for each site. Am I wrong or right, or is this possible?

Comments

domineaux’s picture

I forgot to add:

All sites will be on one server, each site is about entirely different things and has it's own separate domain registration.

I do not want users to be able to access any one site from another, i.e., wedding.com, automobile.com, racing.com, kiddie.com, fragrance.com, shopping.com, etc. I need no linking between the domains of anykind. Each site as I visualize...not knowing much about Drupal. --> Each site has own MySql database with it's own users, logins, features.

The Core Drupal package, core modules and addon modules would be shared among all of the sites forming the multi-site by the server.

Each site would have separate themes.

SEO would be applied to each site separately.

Maybe, I'm completely off base in my thinking about what multi-site means.

The only thing I'm basically trying to accomplish is to have one installation of the Drupal core software and addon modules. This way I would spend a lot less time keeping all the sites updated with latest patches and addon modules. This may be feasible, but in practice a poor idea. I wouldn't know, but I would think server and connection speeds might be a factor.

aireworth’s picture

Your right in what your thinking. Its entirely possible. It does have several elements, all of which need to be right.
Firstly DNS - all the domanin names need to point to the IP address of the server and resolve correctly from the internet. Not part of the Drupal setup.
Secondly you need to configure Apache (or your other webserver) to pass the site name to Drupal. This is done through the vhost.conf or other virtual hosts setting in Apache. What and where the files are depends on your webserver and the platform you're running on. Again, not part of the Drupal setup, but essentially you need to set the base directory to Drupal's home directory and Drupal will then sort out the rest (if you have it set up correctly).
Thirdly you need to have a separate folder, in the Drupal "sites" directory for each and every domain name you want Drupal to handle - e.g. a "/sites/wedding.com/" folder and a "/sites/racing.com/" folder etc. In these folders you need a copy of the settings.php file.
Fourthly, you need to modify each of the separate settings.php files with the database name, location and password to be used for its particular domain.
Finally you need to have a database set up matching the settings in the settings.php file.

Once you've done it 10 times, its only 5 minutes work :-)

Colin

domineaux’s picture

I currently have seven sites setup with Drupal in separate domains.com. Alll the domains are working under Drupal and since I'm using only one server they resolve to the same server IP. The hosting provider points to the respective domains currently.

Secondly you need to configure Apache (or your other webserver) to pass the site name to Drupal. This is done through the vhost.conf or other virtual hosts setting in Apache. What and where the files are depends on your webserver and the platform you're running on. Again, not part of the Drupal setup, but essentially you need to set the base directory to Drupal's home directory and Drupal will then sort out the rest (if you have it set up correctly).

This part is a little confusing - I'm not sure how to setup the Apache, when you say pass the site name to Drupal? If you have a link or something to further information on this it might help. I hate to ask you to reinvent the wheel, so I'm content for sure to look a research other places. Also, I'm thinking my hosting provider will do this, since I cannot seem to edit the php.ini, I'd think the Apache would be set by hosting provider.

-----------------------------------

I can create separate MySql databases for each domain. I'll can probably just create one database and copy it over and name it respectively. If not, it isn't hard to create the MySql databases.

I think I can handle the settings.php as well within the sites folder of Drupal.

--------------------------------------------------

Basically, I'm visually thinking you build one site with Drupal, include all modules addons and themes in this one site. Then make separate MySql databases for each additional site I plan to include in the multi-site.

Again, my hosting Provider will probably have to do the vhost.conf, since they don't allow access to the Apache. I'll just have to tell them what to do.

Any other thoughts or ideas would be appreciated.

Thanks for your response

aireworth’s picture

This part is a little confusing - I'm not sure how to setup the Apache, when you say pass the site name to Drupal? If you have a link or something to further information on this it might help. I hate to ask you to reinvent the wheel, so I'm content for sure to look a research other places. Also, I'm thinking my hosting provider will do this, since I cannot seem to edit the php.ini, I'd think the Apache would be set by hosting provider.

Lots more info (not all of it confusing) in Nancy's Cookbook under Support ->Drupal Handbooks -> Turorials at the top right of this page.

If you are doing multisite from a single installation you need to get Apache working with you.

Colin

jscoble’s picture

All shared modules and themes go in:
/PathToDrupal/sites/all/modules
/PathToDrupal/sites/all/themes

Create a folder in sites for each domain:
/PathToDrupal/sites/Example1.com
/PathToDrupal/sites/Example2.com
/PathToDrupal/sites/Example3.com etc.

The /PathToDrupal/sites/default/ folder is what Apache will use if it cannot find a folder matching the virtual domain.

All site specific folders should have their own settings.php file at the minimum. If you have site specific modules and themes, then those folders are needed too. So your domain specific folder will look like this:

/PathToDrupal/sites/Example1.com/modules
/PathToDrupal/sites/Example1.com/themes
/PathToDrupal/sites/Example1.com/settings.php

Make sure you set the $db_url in each settings.php. If you are using a shared database with table prefixes then the $db_prefix should be set.

For apache, since you already have virtual domains set up, you just need to ask your hosting company to point each domain's DocumentRoot to: /PathtoDrupal. Drupal will automatically take care of the rest.

dshaw’s picture

In addition to the places to look at mentioned above, you can also check out the multisite group at groups.drupal.

I've got several sites under multi-site. It's very handy for upgrading: you only need to update the code base once. Of course, you still need to run update.php for each site. As noted above, you can use either a separate database for each site, or have them on a single database and use the table prefix to differentiate between sites (or a mix of the two, of course). At an admin level there's not much difference. It probably comes down to performance. A high-traffic site should probably have its own database, while having several low traffic sites on a single database should be fine.