How to use Drupal multiple sites feature?

To keep thing as simple as possible I will make the follow assumption:
. Your main Drupal site already is installed at http://maindrupal.yoursite.com
. Your additional Drupal site is installed at http://drupalsub.yoursite.com

Notes:
. You can get a more advanced variation of how to install Drupal multiple sites but I will try to keep thing simple here!
. These steps will put this Drupal installation into your Drupal database that your create for this site

With the above assumption, this article is showing you how to install additional Drupal site that shares the same Drupal installed code but with its own content, template, module, etc.

Here are the steps to install additional sites.

1. Create a database and write down the database's name.

2. Create a database user and write down the user's name and password.

3. Add the database user to your database, and give the user all permissions.

4. Create a drupalsub.yoursite.com subdomain using your Cpanel

5. Make your additional sites point at the Drupal installation directory.
Note: this step is little tricky so I will try to show some detail here
* "maindrupal" is the folder of your main site
* "drupalsub" is the folder of your additional Drupal site.

a. Rename your subdomain folder to something else.
For example mv drupalsub drupalsub.old

b. Create a symlink for you additional Drupal site.
For example: ln -s ~/www/maindrupal ~/www/drupalsub

6. Go to your "maindrupal/sites" folder and copy the default directory, and name the new directory to match your subdomain site name.
For example drupalsub.yoursite.com

Note: when you are done with this step you will see three folders in "maindrupal/sites":
default, all, "drupalsub.yoursite.com"

7. Edit the "drupalsub.yoursite.com/settings.php" file and change the name of the database to the name of the one you just created above

8. You can now install your additional Drupal site using your web browser to http://drupalsub.yoursite.com/install.php and follow through the Drupal install screen.

That's it!

Forums: