Next Tutorial
Drupal 7 Tutorial Part 19: Understanding Drupal 7 Content Types & Fields Concepts !
Drupal 7 Tutorial Part 2: How to install Drupal 7
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.
Extract the folder using below command in linux after navigating to directory where downloaded folder located .
tar -zxvf drupal-7.8.tar.gz
Step 3: Create a database name called d7 in mysql using phpmyadmin wizard or console.
Step 4: Access the url http://locahost/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

11 comments
Thank you for your time to
Thank you for your time to explain to us
Brilliant. Thank you so much!
Brilliant. Thank you so much! I am looking at setting up a new Drupal site and all you tutorials are going to be a tremendous help to me.
What write permissions should
What write permissions should I give to the 'files' folder and the 'settings.php' file after installation? Drupal says this is important for security.
Hi
Hi Alok,
Hosted sites modules/themes files: rw-r-----
Hosted sites "files" directory: rwxrwx---
Hosted sites files under "files" directories: rw-rw----
Hosted sites subdirectories under "files" directories: rwxrwx---
chmod 640 settings.php
chmod 755 ../default
Hope this helps. For more information
http://drupal.org/documentation/install/settings-file
http://drupal.org/node/244924
Cheers,
Anil Sagar
Thanks
Thank you very much. Just one more clarification: In step 6, you've asked to give write permission to the settings.php file. Should I give the same write permission (777) as in step 5?
GIVE 640
640 to the settings.php file .....
Nice writeup!
You may want to update the following lines:
Step 2: Add how one would extract (what command) drupal
Step 4: Change http://localost/d7 to http://localhost/d7
I'll be installing drupal7 on a local debian server on a home network. I'm looking forward to reading the rest of your tutorials as I learn about drupal.
Thank you !
Hi,
Thank you for the changes mentioned. Taken care :-)
Cheers,
Anil Sagar
ну вот началось
Совершенно верно! Мне кажется это очень отличная идея. Полностью с Вами соглашусь.
.............................
Thank you!
Thank you very much for your appreciation. :-)
интереснейший материал
Прошу прощения, что вмешался... Мне знакома эта ситуация. Пишите здесь или в PM.
Post new comment