Drupal, Installing, 2006-12

Background

On 2006-12, I (Dave Allen Barker Jr) installed Drupal for my first time. I had complete access to the host.

Versions

This is not an endorsement of these versions, just what I happened to use during this particular installation.

Drupal
5.0 beta 2
Web Server
Apache 2.2.3
PHP
5.2.0
Database
MySQL Community Server 5.0.27
Host
Debian testing 2006-12 (almost etch)

Procedure

This information does not provide installation instruction on its own—it is meant as a companion to the installation information provided by Drupal and its dependencies.

Filesystem

It is important that we do not grant any more permissions to files and directories than necessary. Because we're working in our user (home) directory, anything we add will have our default user permissions. This may not be enough, but we will grant more as needed.

I made a directory named 620 to put any files (not just Drupal's) this project may need.

Drupal, Get It

Unfortunately, Drupal was not packaged for Debian a the time, so I:

  1. Made a directory named drupal in the 620 directory and changed to it
  2. Downloaded Drupal
  3. Unpacked the tarball
  4. Made a symlink (ln -s) named live to the unpacked drupal directory (drupal-5.0-beta2)

This last step I did in anticipation of future Drupal upgrades. My thought is that simply changing the live simlink will allow "pivoting" into a new Drupal version without changing any settings that might depend on its location.

Requirements Installation

Drupal's INSTALL.txt file specifies its requirements, of which all were available as Debian packages. This made installation as easy as:

  1. aptitude install mysql-server apache2 php5 php5-mysql php5-gd

Note: The need for php5-mysql was discovered later when running the install script, and php5-gd in the "Status report" upon first view of the "Administer" page.

Web Server Configuration

  1. Make a directory named apache2 in my 620 directory
  2. In my apache2 directory, make a httpd.conf file containing the following:

    NameVirtualHost *
    <VirtualHost *>
            ServerName domainname
            Alias / /home/one/var/620/drupal/live/
            <Directory /home/one/var/620/drupal>
                    AllowOverride Indexes Limit Options=Indexes,FollowSymLinks FileInfo
            </Directory>
    </VirtualHost>
  3. Symlink /etc/apache2/sites-available/620 to homedirectory/620/apache2/httpd.conf
  4. Enable the new site (a2ensite 620) and have Apache re-read its configuration (invoke-rc.d apache2 reload)

Note: The AllowOverride directive options were added by trial and error by setting the LogLevel to debug, accessing the site for the first time (to run the install script), checking the Apache error log (/var/log/apache2/error.log), and adding appropriate options until the errors were quelled.

Database Creation

Instructions to create Drupal's database in MySQL are provided in Drupal's INSTALL.mysql.txt file. I chose the following names:

databasename
620drupal
username
620

Note: I began with a database name of 620-drupal but later learned its dash (-) was the reason why the command to set the access database rights was failing me. I also learned that one way to fix the command in MySQL was to escape the database name with backticks (`620-drupal`). This made me nervous, and not wanting to trust that all other programs accessing the database would properly escape my dash laden database name, I removed the dash.

Install Script

The install script (run upon accessing the site for the first time) will need to modify a file that should otherwise not be writeable. From the Drupal directory (620/drupal/live/):

  1. chmod o+w sites/default/settings.php (make Drupal's settings file world writable)
  2. Access the site and complete the "Database Configuration"
  3. chmod o-w sites/default/settings.php (make Drupal's settings file not world writable)

files Directory

From the Drupal default site directory (620/drupal/live/sites/default) make a directory named files, where it and new files under it are owned and writable by the www-data group.

  1. mkdir files
  2. chown :www-data files
  3. chmod g+w files

What's Next

See the initial configuration notes.