September 23, 2010

Installing Drupal In Ubuntu 10.04

Drupal is a an Open Source Content Management System. Installation of Drupal on Ubuntu 10.04 is relatively easy. Just follow the simple steps below:

1. Open a terminal and type:

varsha@varsha-laptop:~$ sudo apt-get install drupal6

2. You'll be prompted to select the database. With your arrow keys select mysql and press enter.

3. Enter your MySQL password when you are asked to. This creates a database schema called drupal6 in your MySQL RDBMS.

This is also supposed to auto-create the necessary files in the /var/www/ directory. But it didn't in my case, so I had to go for manual creation of files. Continue with the following steps only if you do not have a drupal directory in /var/www/.

4. Download the drupal6 source from http://ftp.drupal.org/files/projects/drupal-6.15.tar.gz. Extract and do the following.

5. Create the necessary directory in /var/www/.

varsha@varsha-laptop:~$ sudo mkdir /var/www/drupal

6. Copy the contents of the extracted directory into /var/www/drupal/.

varsha@varsha-laptop:~$ sudo mv drupal-6.15/* drupal-6.15/.htaccess /var/www/drupal

7. Create a directory files in drupal/sites/.

varsha@varsha-laptop:~$ sudo mkdir /var/www/drupal/sites/default/files

8. Change the owner of the directory.

varsha@varsha-laptop:~$ sudo chown www-data:www-data /var/www/drupal/sites/default/files

9. Create the initial configuration files.

varsha@varsha-laptop:~$ sudo cp /var/www/drupal/sites/default/default.settings.php /var/www/drupal/sites/default/settings.php

10. Change the owner of the file settings.php.

varsha@varsha-laptop:~$ sudo chown www-data:www-data /var/www/drupal/sites/default/settings.php

11. Create a database drupal6 using phpMyAdmin.

varsha@varsha-laptop:~$ mysqladmin -u root -p create drupal6

12. Log in to MySQL if you already have lamp-server installed on your system.

varsha@varsha-laptop:~$ mysql -u root -p

13. Grant permissions to the root user (or the username you log into MySQL with) on all tables in drupal6 schema.

mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON drupal6.* TO 'username'@'localhost' IDENTIFIED BY 'password';

Here, 'username' is either root or any other username you use to log into MySQL and 'password' is the password of the username.

14. Open your browser and type http://localhost/drupal/. You'll get the following page if you haven't created a database for Drupal.




Enter the details and click on Save and continue.

15. Next you'll get a screen as follows.



Enter your email address under Site information. Under Administrator account, enter a username, email address and password. I used my phpMyAdmin username and password and my email address. Click Save and continue.

16. Then you get a page saying "Drupal installation complete". Go to your new site.




Installation complete!



Using GIT Behind Proxy

GIT uses GIT protocol. So if you need to clone any source, you need to do the following:

1. varsha@varsha-laptop:~$ git clone git://git.gnome.org/path/of/source

2. If the above works fine for you, then you don't have to do anything else. Otherwise, if you get the following error, then proceed to Step 3.

git.gnome.org[0: 209.132.180.173]: errno=Connection timed out
fatal: unable to connect a socket (Connection timed out)

3. Check if you have set up your system proxy.

varsha@varsha-laptop:~$ echo $http_proxy
http://172.16.1.13:3128/


4. If not, set the proxy.

export http_proxy="<address:port>"

5. Try cloning from GIT again, but this time use http:// instead of git://.

varsha@varsha-laptop:~$ git clone http://git.gnome.org/path/of/source