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.
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.
- Apache 2.x (Recommended)
- PHP 5.2.5 or higher (5.3 recommended)
- 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 “192.168.50.2“. 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 firstname.lastname@example.org 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.
Step 9: Choose language, click on Save and Continue
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.
Step 11: Installing Drupal
Step 12: Site Configuration
Fill up the details like Site name, Site e-mail address, Site Maintenance UserID and Password etc.
Step 13: Drupal installation Completed
Step 14: Login in Drupal Site administration or Dashboard
Step 15: drupal.tecmint.com site dashboard
Drop your comment, if you have any query in this regard on comment box below.
Latest posts by Narad Shrestha (see all)
Linux Services & Free WordPress Setup
Our post is simply ‘DIY’ aka ‘Do It Yourself, still you may find difficulties and want us to help you out. We offer wide range of Linux and Web Hosting Solutions at fair minimum rates. Please submit your orders by Clicking Here.