Did You Know?
Donate to TecMint

LFCS - Linux Foundation Certified SysAdmin - Exam Preparation Guide

Install Drupal 7.22 (Content Management Framework (CMF) in on RHEL, CentOS & Fedora

Download Your Free eBooks NOW - 10 Free Linux eBooks for Administrators

Drupal is well known Content Management Framework (CMF) written in PHP. It has been widely used from personal purpose such as blogging to professional website. Drupal also allows users to organize, publish and manage variety of content on website like WordPress & Joomla. It’s freely available to download and use.

Drupal runs on a web server like Apache, IIS, Lighttpd, Cherokee, Nginx and store contents backend databases MySQL, MongoDB, MariaDB, PostgreSQL, SQLite, MS SQL Server. We’ll be installing Drupal using LAMP (Linux, Apache, MySQL, PHP) installation method.

Install Drupal CMS in Linux

Install Drupal CMS in Linux

In this post, we will go over how to perform a manual installation of latest Drupal 7.22 version on RHEL, CentOS and Fedora using LAMP setup.

What is LAMP?

LAMP stack is an open source web development software used to run web application. Wherein Linux is an Operating system, Apache is a Web Server, MySQL is a database and PHP is an object-oriented programming language. Please follow below link to install LAMP stack.

  1. Setup LAMP (Linux, Apache, MySQL, PHP) on RHEL, CentOS & Fedora

Drupal Requirement:

  1. Apache 2.x (Recommended)
  2. PHP 5.2.5 or higher (5.3 recommended)
  3. MySQL 5.0.15 or higher with PHP Data Objects (PDO)

In this post, I have used hostname as “drupal.tecmint.com” and IP address is ““. These settings may differ at your environment, so please make changes as appropriate.

Installing Drupal 7.22 on RHEL, CentOS & Fedora

This installation method guide you how to install latest Drupal 7.22 using LAMP setup on RHEL, CentOS and Fedora.

Step 1: Download Drupal 7.22

Navigate and go to the directory from where we’ll be serving Drupal site. By default in most of *nix, server’s document root will be “/var/www/html“. Download Drupal with any download utility. Here, I’ll be using wget command.

[root@tecmint www]# wget http://ftp.drupal.org/files/projects/drupal-7.22.tar.gz

Step 2: Extract Compressed Drupal

Extract Drupal package which will create drupal-7.22 directory. After successfully extract, remove compressed version of Drupal.

[root@tecmint www]# tar -zxvf drupal-7.22.tar.gz

Remove source file and change ownership of directory with user and group Apache recursively with below command.

[root@tecmint drupal]# chown -R apache:apache /var/www/drupal

Step 3: Apache Configuration

Open Apache configuration file with editor.

[root@tecmint ~]# vi /etc/httpd/conf/httpd.conf

Search directive as below and change it appropriate.

ServerAdmin admin@tecmint.com

ServerName drupal.tecmint.com:80

Step 4: Restart httpd (Apache) Service

Restart Apache service.

[root@tecmint ~]# service httpd restart

To make httpd service started automatically in next boot with below command.

[root@tecmint ~]# chkconfig --level 35 httpd on

Verify your httpd is running and listening request on port 80

[root@tecmint ~]# netstat -antp | grep httpd

tcp     0      0 :::80            :::*          LISTEN 1705/httpd

Step 5: Create the settings.php file

Make a copy of sample configuration file which resides under Drupal directory ‘sites/default/default.settings.php’. Copy default file re-name it be ‘settings.php‘.

[root@tecmint drupal-7.22]# cp sites/default/default.settings.php sites/default/settings.php

Cautions: Don’t delete or rename default ‘default.settings.php‘ file as Drupal installer requires both files.

Now make a “settings.php” file and “default” directory writable by installer.

[root@tecmint drupal-7.22]# chmod a+w sites/default/settings.php
[root@tecmint drupal-7.22]# chmod a+w sites/default/

Note: Do not forget to change permissions back after you have run the installation script. Permissions should be as.

[root@tecmint drupal-7.22]# chmod 644 settings.php
[root@tecmint drupal-7.22]# chmod 755 ../default

Step 6: Create the MySQL Database

Set root password for MySQL login and creating database using following commands.

[root@tuxbox ~]# mysqladmin -u root password 'redhat'

Login with root credential in MySQL.

[root@tecmint ~]# mysql -u root -p

Create database called “drupal” in MySQL.

mysql> create database drupal;
Query OK, 1 row affected (0.05 sec)

Grant privileges on “drupal” database for “drupal” user in MySQL.

mysql> grant all on drupal.* to drupal@'localhost' identified by 'redhat';
Query OK, 0 rows affected (0.22 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

Restart MySQL Service.

[root@tecmint ~]# service mysqld status
[root@tecmint ~]# service mysqld restart
[root@tecmint ~]#chkconfig --level 35 mysqld on

Step 7: Iptables (Firewall) Configuration

Please open port 80 on firewall or disable iptables.

[root@tecmint html]# iptables -A INPUT -p tcp --dport 80 -j ACCEPT
[root@tecmint html]# service iptables save
[root@tecmint html]# service iptables restart

Step 8: Installation and Configuration of Drupal

Open Browser and type “http://drupal.tecmint.com” which will open below screen to configure Drupal. Select ‘Standard‘, click on Save and Continue.

Drupal Installation

Drupal Installation

Step 9: Choose language, click on Save and Continue

Select Drupal Language

Select Drupal Language

Step 10: Database Configuration

Fill up the details like database name, username and password which was set earlier in “Step 6:” and click on Save and Continue.

Drupal Database Setup

Drupal Database Setup

Step 11: Installing Drupal

Installation of Drupal

Installation of Drupal

Step 12: Site Configuration

Fill up the details like Site name, Site e-mail address, Site Maintenance UserID and Password etc.

Drupal Site Configuration

Drupal Site Configuration

Drupal Server Settings

Drupal Server Settings

Step 13: Drupal installation Completed

Drupal Installation Completed

Drupal Installation Completed

Step 14: Login in Drupal Site administration or Dashboard

Drupal Login Administration

Drupal Login Administration

Step 15: drupal.tecmint.com site dashboard

Drupal Dashboard

Drupal Dashboard

Drop your comment, if you have any query in this regard on comment box below.

He has over 10 years of rich IT experience which includes various Linux Distros, FOSS and Networking. Narad always believes sharing IT knowledge with others and adopts new technology with ease.

Your name can also be listed here. Work as a Paid freelancer/writer at TecMint.
Download Free eBooks
Advanced Bash-Scripting Guide
Linux Bible
A Newbie's Getting Started Guide to Linux
Ubuntu Linux Toolbox: 1000+ Commands

2 Responses

  1. Mohammed M. Badr says:

    Requirements problem

    Web server Apache/2.2.15 (CentOS)
    OK PHP 5.3.3
    OK PHP register globals Disabled
    Error PHP extensions Disabled

    Drupal requires you to enable the PHP extensions in the following list (see the system requirements page for more information):


    Error Database support Disabled

    Your web server does not appear to support PDO (PHP Data Objects). Ask your hosting provider if they support the native PDO extension. See the system requirements page for more information.

    OK PHP memory limit 128M

    Error File system

    The directory sites/default/files is not writable. An automated attempt to create this directory failed, possibly due to a permissions problem. To proceed with the installation, either create the directory and modify its permissions manually or ensure that the installer has the permissions to create it automatically. For more information, see INSTALL.txt or the online handbook.

    Warning Unicode library Standard PHP

    Operations on Unicode strings are emulated on a best-effort basis. Install the PHP mbstring extension for improved Unicode support.

    OK Settings file The ./sites/default/settings.php file exists.

    Error Settings file The settings file is not writable.

    The Drupal installer requires write permissions to ./sites/default/settings.php during the installation process. If you are unsure how to grant file permissions, consult the online handbook.

    Check the error messages and proceed with the installation.

  2. saurabh says:

    disable selinux in fedora before you proceed with the installation steps

Leave a Reply

This work is licensed under a (cc) BY-NC | TecMint uses cookies. By using our services, you comply to use of our cookies. More info: Privacy Policy.
© 2012-2014 All Rights Reserved.