Ubuntu Server

Install Apticron Update Alerts

Apticron is a handy little application that uses cron to check for updates to your Ubuntu Server install on a daily basis. It will check in with the Ubuntu mothership and send you email if any new updates are available, which is important for avoiding known security vulnerabilities.

Install apticron: to send a daily email alert if there are available updates for your system:

sudo apt-get -y install apticron

Configure apticron to check for updates daily and send email if any new updates are available:

Install PHP Scripting Language

PHP is the scripting language upon which Drupal is built. Drupal 7 requires PHP version 5.2 or greater, however these instructions will install PHP version 5.3. Note that, as of this writing, many Drupal modules have not been upgraded to work with version 5.3. It may be necessary to back-grade to version 5.2.

Install MySQL Database Server

MySQL is the recommended database for Drupal, and Drupal 7 requires version 5.0.15 or higher. The following will walk you through installing MySQL server on Ubuntu Server and creating a database for your first Drupal site. More details are available in the MySQL section of the Ubuntu Server Guide.

Choose an Operating System

Drupal will run on a number of operating systems, however it is typically installed on a LAMP stack (Linux, Apache, MySQL and PHP). When choosing an OS for Drupal, it is important to clearly identify your requirements. The following are the operating system selection criteria we used for the purpose of this cookbook:

Build a VirtualBox Virtual Machine

Originally developed by Sun, Oracle VirtualBox is an open source virtualization product for x86 and AMD64/Intel64 hardware. VirtualBox currently runs on Windows, Linux, Macintosh and OpenSolaris host operating systems. Because it is free, open source and stable, VirtualBox is a viable choice for desktop development environments or low cost enterprise server implementations.

Install Postfix Email Server

Postfix is a mail transfer agent that enables sending email from Drupal. This is required, for example, to enable Drupal-based contact forms and user registration confirmation messages. We will assume that you have already correctly configured MX records in DNS.  The following instructions cover the minimum required to send email from Drupal.

Install Drupal 7

Now that you've got all the pieces in place, let's install and configure Drupal 7. Go to the Drupal Installation Guide for detailed installation instructions.

Create settings.php and write-enable for the Drupal installer:

sudo cp /var/www/www.example.com/sites/default/default.settings.php /var/www/www.example.com/sites/default/settings.php
sudo chmod a+w /var/www/www.example.com/sites/default/settings.php

Set user and group ownership for all Drupal files and directories:

Install Apache Web Server

In this tutorial, we will install and configure the Apache http server on Ubuntu Server for both http (port 80) and https (ssl over port 443). While Drupal will run on a number of web servers, Apache is by far the most commonly used for both development and production. For more details, check out the Apache2 Web Server section of the Ubuntu Server Guide.

Install apache2:

Install OpenSSH

OpenSSH is a collection of applications that enable secure remote communication with your Linux server using the ssh protocol. This is used primarily for secure remote shell access and file transfer. The most secure current authentication method is via public key authentication, which is far superior to username and password authentication.

Install Ubuntu Server 10.04 LTS

This tutorial will walk you through a base installation of Ubuntu Server 10.04 LTS (64-bit). Ubuntu releases a new OS version every six months. Every two years, however, a Long Term Support (LTS) version is released, which is supported for three years for the desktop version and five years for the server vesion. Version 10.04 is the current LTS release as of this writing, which makes it ideal for enterprise use and meets our requirement for long service life.