From wiki.ucalgary.ca
Jump to: navigation, search

About the Drupal hosting distribution

I've set up a shared instance of Drupal 4.7Beta4 on apollo.ucalgary.ca, and added a bunch of useful modules and themes. This setup can be used to serve as many community sites as we need, from a shared set of deployed files. Updates to this deployment will be shared with all sites instantly (which could be a problem if there's a major database change between versions - which is why I deployed with a 4.7 beta rather than a 4.6 final).

The software is installed at


How to add a site

Sites are defined by directories in


For this example, I'll show how to set up a Drupal site for a project hosted at a mythical "www.community-project.ca" domain.

Configuring Drupal

The easiest way to get going is to duplicate the "default" site directory, renaming the copied directory "www.community-project.ca"

In the new directory, edit the "settings.php" file. You'll need to change 2 lines.

On line 86, change the database name at the end of the line to "drupal_communityproject"

On line 103, change the base_url to 'http://www.community-project.ca'

Creating a database

You'll need to create a database, so run this:

mysql -u root -p
create database drupal_communityproject;
mysql -u root -p drupal_communityproject < /Library/WebServer/Drupal/drupal_template.sql;

You're almost there, Sparky. Drupal is set up, the database is ready. Now you just have to configure Apache to respond to the domain.

Configuring Apache

Fire up Server Admin.app, and open up "apollo.ucalgary.ca" Click on the Web section, and select the "drupal.commons.ucalgary.ca" entry. With that entry selected, hit the "Duplicate Selected Web Site." button.

Enter the appropriate domain info, and hit Save.

DNS Issues

Make sure you have www.community-project.ca resolving to (you will need to create or update the DNS entry for that domain). In the meantime, you can add this line to your /etc/hosts file to test the site until the domain is properly resolving	www.community-project.ca

Logging In

You should now be able to access the Drupal site being hosted from the shared Drupal installation by visiting www.community-project.ca in your browser. An admin account is already created, and the password is - wait. Not going to put our shared/default login in a wiki page... If you need to know it, you already do - or ask D'Arcy.