Drupal

Basic Assumptions

  • This guide assumes you:
  • Are not scared of CLI (and using bash)
  • Will be using Drupal 6.x
  • Have a little experience with websites
  • Will be using /var/www for your source
  • Will be using yoursite.com to refer to your site
  • Were not offended here (we did say basic)

Drupal Installation

  1. Grab the latest release from http://www.drupal.org

  2. Unpack to /var/www/drupal6
    1. If you install Drupal through the repositories the directory will be different
  3. Create an Apache configuration
    1. vim /etc/apache2/sites-available/drupal6
  4. Enable the configuration
    1. a2ensite drupal6
  5. Restart Apache
    1. /etc/init.d/apache2 restart

Sample Configuration:

## This is a basic config; mine has some extras for security.
<VirtualHost *:80>
  DocumentRoot /var/www/drupal6

  <Directory /var/www/drupal6/>
    Options +FollowSymLinks

    ## These rewrites allow for CleanURL's
    RewriteOptions inherit
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

    AllowOverride All
    order allow,deny
    allow from all
  </Directory>
</VirtualHost>

Create Database

Create a database and database user

  • Replace $database and $pass with appropriate values

echo "CREATE DATABASE $database;" | mysql -uroot -p
echo "GRANT ALL ON $database.* TO '$database'@'localhost' IDENTIFIED BY '$pass';" | mysql -uroot -p

Create Website Files

The Ubuntu Drupal team suggests using a multisite setup)

cd /var/www/drupal6/sites
mkdir -p yoursite.com/{files,modules,themes}
cp default/default.settings.php yoursite.com/settings.php
chmod 777 yoursite.com/settings.php yoursite.com/files

Grab module/theme builds

Option 1: [Stable]

Drupal.org is used to host the stable releases of the modules/theme. You can use the following URL's to grab them. This is suggested over grabbing the development versions because you will automatically be notified of updates.

/var/www/drupal6/sites/yoursite.com/themes

/var/www/drupal6/sites/yoursite.com/modules

Option 2: [Development]

Using the development copies should just be used for development or testing purposes. Unless you have a solid reason for using the development version, it's suggested that you use the previous method.

First, you need to install bazaar:

sudo apt-get install bzr

Optional: To configure bazaar to talk to your launchpad account: Read the Contributors guide to launchpad. Then:

bzr launchpad-login YourLaunchpadID
bzr whoami "FirstName LastName <your@email.com>"

If you configured bazaar to talk with your LP account, you can run a few short bzr commands.

cd /var/www/sites/yoursite.com

## Theme
bzr branch lp:ubuntu-drupal-theme themes/ubuntu-drupal

## Ubuntu-Drupal Managed
bzr branch lp:ubuntu-drupal-header modules/header
bzr branch lp:ubuntu-drupal-sidebar modules/sidebar
bzr branch lp:ubuntu-drupal-countdown modules/countdown
bzr branch lp:ubuntu-drupal-locomap modules/locomap
bzr branch lp:ubuntu-drupal-planet modules/planet

## Canonical Managed (OpenID)
bzr branch lp:ubuntu-drupal-openid modules/openid
bzr branch lp:ubuntu-drupal-launchpad modules/openid-launchpad
bzr branch lp:ubuntu-drupal-teams modules/openid-teams

Finish Installation

  1. Go to yoursite.com
  2. Perform a standard installation
    1. "Install Drupal in Language"
    2. Enter details from "Create Database" section"
    3. Toss in standard info
    4. Click "You may now visit your new site."
  3. Clean up permissions
    1. chmod 774 /var/www/sites/yoursite.com/*

Setup Site

This section use to describe how to setup each module. However, the number of modules we manage has become too large. We've pushed for simplicity and hope that configuring these modules will be inherently easy. If it's not, please come yell at us and let us know how we can make things easier.

UbuntuDrupal/Setup/Drupal (last edited 2010-07-04 13:32:47 by 41)