Installing Drupal on Linux

First of all, go to http://www.drupal.org and copy the link for Drupal 6. At the time of writing, Drupal 6.16 is available. Then type the following in the terminal:

$ wget http://ftp.drupal.org/files/projects/drupal-6.16.tar.gz

Unzip the files to you directory of choice. The following code would unzip to the directory /var/www/html.

$ tar xzvf drupal-6.16.tar.gz -C /var/www/html

You should see a directory called drupal-6.16. Rename it to a name of your choice. This name would be visible in your URL if you use the default settings.

$ mv drupal-6.16 web

Open a web browser and type the following address in a web browser

http://localhost/web/index.php

You would see a web page with the an error message saying "Copy the ./sites/default/default.settings.php file to ./sites/default/settings.php." and another error message saying "The directory sites/default/files does not exist.". Do the following:

$ cd /var/www/html/web/sites/default/
$ cp default.settings.php settings.php
$ chmod 777 settings.php
$ mkdir files
$ chmod -R 777 files

Refresh the screen and the errors would be gone. The next screen would request your database name, user name and password. Assuming, you haven't created a database, do the following:

$ mysql -u root -p

Type your password to log into MySQL DB.

mysql> create database drupal;
mysql> create user drupal_user;
mysql> grant all on drupal.* TO 'drupal_user'@'localhost' IDENTIFIED BY 'xxxxxx';
mysql> flush privileges;

For the web form, the database name is 'drupal', user name is 'drupal_user' and the password is whatever you typed in place of 'xxxxxx'.

Drupal installed and ready to use. Change the permissions on settings.php to 755.

$ chmod 755 settings.php