Setting Up a MultiSite Drupal Installation Using cPanel

Recently, I had a need to set up a multisite installation on a shared hosting environment (Hostmonster).  My only access to the server currently, until I jump through the appropriate hoops to get SSH access, is FTP and cPanel.  Try as I might, I had difficulties with the installation until I found this article here.  Unfortunately, there are just a few missing steps, so with credit to the original author, kham08 over at Drupal Groups, I am going to give a fuller explanation.  Finally, play careful attention to when you use site1 and site1.yourdomain.com.  It does matter.

  1. In CPanel, set up the subdomain and point it to http://yourdomain.com (The DNS updates from the subdomain add/redirect can take several hours to complete.......). For the example of site1.yourdomain.com, a folder named 'site1' will be automatically created by CPanel. Delete the folder that was created. (NOTE: many cPanels will display the document root as /public_html/site1.  There is no reason to create a redirect).
  2. Create a folder in the sites/ folder that matches the subdomain you want to create (so for site1.yourdomain.com, the folder name would be site1.yourdomain.com).
  3. Create directory /sites/site1.yourdomain.com/files/ with permission 777.
  4. Duplicate the settings.php file from the default folder and place it in your newly created folder from step 2.
  5. Edit the settings.php file you just placed in the site1.yourdomain.com folder so that it does not point to a database. You can replace the line that has your other site's database information with this: 

$db_url = 'mysql://username:password@localhost/databasename'; 
You will also need to edit the line that assigns the base url with this:
$base_url = 'http://site1.yourdomain.com';  // NO trailing slash!
 
6.  Then give settings.php permissions of 777 (Drupal will reset permissions to 644 when it is finished with the file). This will allow step 10 below to load your database tables.
7.  Use the following example to create a 'multisite.php' file and upload via FTP or CPanel's File Manager. Make sure you change the path to whatever the path to your web root is.
 
<?php
  symlink( '/home/username/public_html/',

'site1' );
?>

 
8.  Create a database and database user for site1.yourdomain.com.  Depending on your hosting provider this can be done in phpMyAdmin or a separate icon under Databases in the cPanel.  Hostmonster does this under an icon labeled MySQL Databases.  Keep track of of the database name and database user and database password.  Also don't forget to grant all permissions for the database to this database user.
10.  Go to your subdomain and start the Drupal 6 installation process. Drupal will ask for your database information and then install the tables necessary to run the new site.
11.  You're all set to use the new site.