After spending the afternoon scratching my head on this, I've figured out how to perform a Drupal multi-site install using Turnkey Drupal6 and Amazon EC2.
(This information is based upon other more general Drupal articles but is specific to issues using Turnkey Drupal 6 on AWS.)
First carefully follow instructions elsewhere on this site on successfully setting up the Drupal 6 Appliance as an instance in the Amazon cloud. Ensure that the Default single drupal is running prior to creating a multisite host.
- First go to phpmysql and verify that you have a user setup with the proper permissions. If not create a user with SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER permissions. (in this example we will use user "drupal6")
- Then create an empty db for my site: eg: mysite_db
- Go to /usr/share/drupal6/sites/ and copy the default directory
- Renamed the default directory according to the name of the domain: eg: mysite.org
- Open up mysite.org directory and edit the dbconfig.php file.
$dbuser='drupal6'; $dbpass='userpassword'; $basepath=''; $dbname='mysite_db'; $dbserver=''; $dbport=''; $dbtype='mysql';
- Save file.
- Repeat steps 3-7 for each of the sites you will be hosting.
Then open the Apache configuration file at
Look for the
Directorysections for "/" and "/var/www/" and change the line:
(See https://help.ubuntu.com/community/EnablingUseOfApacheHtaccessFiles for more information).
Save this file.
Create a new vhost file and enter the following - replacing bolded items (this is a funtional example):
<VirtualHost *:80> ServerName www.mysite.org ServerAlias *.mysite.org UseCanonicalName Off ServerAdmin email@example.com DocumentRoot /usr/share/drupal6/ </VirtualHost> <Directory /usr/share/drupal6/> Options +FollowSymLinks AllowOverride All order allow,deny allow from all </Directory>
Close and save the vhost file using a name based upon your site's domain (eg: mysite.org )
Repeat steps 12 - 14 for each of the sites.
Now that vhost files have been created, for each site you wish to enable, enter "a2ensite sitename" (example: "a2ensite mysite.org")
(for more information about a2ensite and a2dissite see here)
When you are finished reload apache.
sudo /etc/init.d/apache2 reload
Go to your DNS hosting service and, for each domain set the CNAME record to the AWS Public DNS (example: www = ec2-85-121-347-131.compute-2.amazonaws.com). Set the A (HOST) record to either the public DNS or IP number. (Sorry, not trying to be vague, but this step differs widely depending upon vendors and is beyond the scope of this tutorial).
Then go to the drupal install page for your new site (eg: www.mysite.org/install.php ) and follow the standard Drupal install proceedure.
Enjoy your Drupal multi-site!