Drupal 7 Tutorial Part 2: How to install Drupal 7

posted Jun 23, 2011, 12:10 AM by admin@ revitviet.vn

Hi Everyone,

In this tutorial i am going to explain how to install Drupal 7 on a machine with ubuntu operating system. To install and run Drupal 7 we need to install following software.

  • Web Server - Apache:

Step 1: Install apache 2 by entering this command in linux terminal.

~$> sudo apt-get install apache2

Step 2: Now apache is installed and running in your system. You can verify this by typing this url on your bowser.

http://localhost/ . It will show the message It works!

Optionally you can check the apache status by entering the below command in terminal.

~$> sudo /etc/init.d/apache2 status
On successful it will show * Apache is running

Step 3: You can any time stop or start or restart apache using the below commands. For drupal to run you need to ensure apache is started and running.

Command to start : ~$> sudo /etc/init.d/apache2 start
Command to stop : ~$> sudo /etc/init.d/apache2 stop
Command to restart : ~$> sudo /etc/init.d/apache2 restart

  • Database Server - MySQL:

                 Drupal 7 will only support MySQL 5.0.15 or higher.

Step 1: Install MySQL by entering this command in linux terminal.

~$> sudo apt-get install mysql-server-5.1

Step 2: Now MySQL is installed and running in your system.

Optionally you can check the mysql status by entering the below command in terminal.

~$> sudo /etc/init.d/mysql status
On successful it will show like below.

Server version 5.1.37-1ubuntu5.1
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/run/mysqld/mysqld.sock
Uptime: 3 min 30 sec

Step 3: You can any time stop or start or restart MySQL using the below commands. For drupal to run you need to ensure MySQL is started and running.

Command to start : ~$> sudo /etc/init.d/mysql start
Command to stop : ~$> sudo /etc/init.d/mysql stop
Command to restart : ~$> sudo /etc/init.d/mysql restart

  • PHP:

PHP 5.3 for Drupal 7 is recommended. Drupal 7 works with PHP 5.2.5 or higher.

Step 1 : Execute these commands in linux terminal.

~$> sudo apt-get install php5
~$> sudo apt-get install libapache2-mod-php
~$> sudo aptitude install php5-mysql

Step 2 : Restart apache and mysql
~$>sudo /etc/init.d/apache2 restart
~$>sudo /etc/init.d/mysql restart

Step 3 : Create a file info.php in /var/www folder with the below code.
<?php
echo phpinfo();
?>

On successful installation of php you will see configuration of php in http://locahost/info.php

  • PHPMYADMIN INSTALLATION:

Step 1 : Run this command in terminal

~$>sudo aptitude install phpmyadmin

Step 2 : Select Apache as default webserver from the dialog popup.

Step 3 : Restart Apache

~$>sudo /etc/init.d/apache2 restart

Step 4 : Navigate to http://localhost/phpmyadmin You can able to see the phpmyadmin wizard.

  • Drupal 7 Installation:

Step 1: Download latest drupal 7 from drupal.org. http://ftp.drupal.org/files/projects/drupal-7.0.tar.gz

Step 2: Place the downloaded folder in /var/www and extract the contents from downloaded tar file. Rename the extracted folder to d7.

Step 3: Create a database name called d7 in mysql using phpmyadmin wizard or console.

Step 4:  Access the url http://localost/d7 . You will get a page with title "Select an installtion profile".  Select "standard" option and click on save and continue button. Now choose language as english which is default option and click on save and continue button.

Step 5: Create a folder named files inside sites/default of your drupal installation folder. Give 777 permissions to the files folder using command sites/default ~>  chmod -R 777 files

Step 6: The Drupal installer requires that you create a settings file as part of the installation process. Copy the ./sites/default/default.settings.php file to ./sites/default/settings.php and give write permission to the file. Now click on Proceed with installation link at bottom.

Step 7: Now in Database Configuration Screen provide the databasename as d7 that we created using phpmyadmin, provide the mysql username and password fields to complete database configuration. Click on Save and Continue Button to install drupal.

Step 8: Configure your site by entering email address and super admin username passwords to complete the installation.

Step 9: If everything goes smoothly you will see message called Congratulations, you installed Drupal! and link to your new Drupal 7 site.

Feel free to drop a comment if you face any issues.

Cheers,

Anil Sagar

Comments