• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

How to Install Drupal in Debian / Ubuntu

626

To Install Drupal in Debian / Ubuntu

Drupal is a popular open source Content Management System (CMS), which was released under GPL. The drupal source code was written in PHP language. It is used as a back-end framework for most of the websites and also used for knowledge management system. This article explains how to install Drupal in Debian / Ubuntu.

Features

  • It provides support for creating forums, blogs and polls using modules.
  • Some of its basic features are RSS feed, users registration, modify templates and ability to publish posts/ pages.
  • Available in more than 110 languages and contains more than 30000 modules.
  • Free and Open Sourced.
  • Notifies you about security updates.
  • All basic features of website like, publish posts, pages, install and modify templates & add-ons etc are available.
  • Available in more than 110 languages.

To update repositories

Run the following command to update your repositories before installing any packages.

root@linuxhelp:~# apt-get update
Hit http://in.archive.ubuntu.com wily InRelease
Get:1 http://security.ubuntu.com wily-security InRelease [65.9 kB]    
Get:2 http://in.archive.ubuntu.com wily-updates InRelease [65.9 kB]          
Hit http://in.archive.ubuntu.com wily-backports InRelease
.
.
.
Hit http://in.archive.ubuntu.com wily-backports/universe Translation-en        
Fetched 1,670 kB in 25s (65.6 kB/s)                                            
Reading package lists... Done

To Setup LAMP Server

A running web server and a database server is necessary to install Drupal. Apache, PHP and MySQL can be installed using the the following command.

root@linuxhelp:~# apt-get install apache2 php5 php5-mysql mysql-client mysql-server libapache2-mod-php5 php5-gd php5-curl libssh2-php -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libavahi-client-dev libavahi-common-dev libavahi-compat-libdnssd1
  libdbus-1-dev libjs-jquery libruby2.1 libyaml-0-2 ruby2.1
.
.
.
Module mpm_event disabled.
Enabling module mpm_prefork.
apache2_switch_mpm Switch to prefork
apache2_invoke: Enable module php5
Setting up php5 (5.6.11+dfsg-1ubuntu3.3) ...
Processing triggers for libc-bin (2.21-0ubuntu4) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (225-1ubuntu9) ...


Enter the password for the MySQL root user


MySQL root user password

Re-enter to confirm the password.
password confirmation

To setup the database for drupal in mysql

Use the following command to connect to mysql shell and run the following commands to create database, database user and to set permission for database user.


root@linuxhelp:~# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with   or g.
Your MySQL connection id is 2
Server version: 5.6.30-0ubuntu0.15.10.1 (Ubuntu)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ' help '  or ' h'  for help. Type ' c'  to clear the current input statement.
mysql>  CREATE USER drupal@localhost IDENTIFIED BY " 123"  
Query OK, 0 rows affected (0.06 sec)
mysql>  create database drupal 
Query OK, 1 row affected (0.04 sec)
mysql>  GRANT ALL ON drupal.* TO drupal@localhost 
Query OK, 0 rows affected (0.02 sec)
mysql>  FLUSH PRIVILEGES 
Query OK, 0 rows affected (0.00 sec)
mysql>  exit
Bye

To Configure php.ini file

Now edit the php.ini file located in the path ' /etc/apache2' and search for the expose_php and allow_url_fopen parameter inside the php.ini file and set it ' off ' for both option. Then remove the semicolon( ) before the parameter ' extension=msql.so'

root@linuxhelp:~# vim /etc/php5/apache2/php.ini 
expose_php=off
allow_url_fopne=off
extension=msql.so


Open the apache2.conf file located in ' /etc/apache2' and change ' AllowOverride None' to ' AllowOverride all' for all the parameters.

root@linuxhelp:~# vim /etc/apache2/apache2.conf 
AllowOverride all


Next enable the rewrite functionality for the Apache server. After enabling restart the service for apache.

root@linuxhelp:~# a2enmod rewrite
Enabling module rewrite.
root@linuxhelp:~# service apache2 restart

To Download and Install Drupal 8.1.1

Drupal can be downloaded from the official repository of Ubuntu/ Debian as a package. It is suggested to download from the official website of Drupal to protect from the vulnerabilities of older version available in the repository of Ubuntu/ Debian.
use the following link to download drupal,
https://www.drupal.org/project/drupal
Run the following command to download drupal using wget command.

root@linuxhelp:~# wget https://ftp.drupal.org/files/projects/drupal-8.1.1.tar.gz--2016-05-06 15:48:59--  https://ftp.drupal.org/files/projects/drupal-8.1.1.tar.gz
Resolving ftp.drupal.org (ftp.drupal.org)... 103.245.222.68
Connecting to ftp.drupal.org (ftp.drupal.org)|103.245.222.68|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12533960 (12M) [application/octet-stream]
Saving to: ‘ drupal-8.1.1.tar.gz’ 
drupal-8.1.1.tar.gz 100%[=====================> ]  11.95M   304KB/s   in 45s    
2016-05-06 15:49:44 (273 KB/s) - ‘ drupal-8.1.1.tar.gz’  saved [12533960/12533960]


Now extract the file using the following command.


root@linuxhelp:~# ls
Desktop    Downloads            examples.desktop  Pictures  Templates
Documents  drupal-8.1.1.tar.gz  Music             Public    Videos
root@linuxhelp:~# tar -zxf drupal-8.1.1.tar.gz
root@linuxhelp:~# ls
Desktop    Downloads     drupal-8.1.1.tar.gz  Music     Public     Videos
Documents  drupal-8.1.1  examples.desktop     Pictures  Templates


Create a directory for drupal. Copy the extracted files and .htaccess files into it. The file ' .htaccess' is responsible for redirecting the links to our website.



root@linuxhelp:~# mkdir /var/www/html/drupal
root@linuxhelp:~# cp -R drupal-8.1.1/* drupal-8.1.1/.htaccess /var/www/html/drupal/


It is required to create a subdirectory in default site installation directory. It is used by the files such as custom logos, user avatars, and other media associated with our new site.

root@linuxhelp:~# mkdir /var/www/html/drupal/sites/default/files
root@linuxhelp:~# chown www-data:www-data /var/www/html/drupal/sites/default/files


It is also required to create the initial configuration file for the default site and restart the services.

root@linuxhelp:~# cp /var/www/html/drupal/sites/default/default.settings.php /var/www/html/drupal/sites/default/settings.php
root@linuxhelp:~# chown www-data:www-data /var/www/html/drupal/sites/default/settings.php


Navigate to http://yourdomain.com/drupal or http://< your-ip-address> /drupal


dashboard

Now choose your language and click save and continue.
language

Now select the installation profile of your choice and click save and continue.
installation profile

Now enter the details to configure database and click save and continue.
Database configuration

The drupal installation starts as shown below.
installation

After installation, enter the details to configure your site.
site information

Select the country and time zone. Click save and continue
location and time

Now the home page for the site appears as shown below.
homepage

We can add the content for the site by clicking ' Add content' .
welcome page

Choose ' Basic page' to add a static content for basic pages. Give a title for the site and click the source tab. Then write your own content inside the text box.
add content

Now click save and publish to publish the site to drupal’ s home page.
save and publish

The site appears inside the drupal home page as shown below.
blog

Tags:
christian
Author: 

Comments ( 0 )

No comments available

Add a comment

Frequently asked questions ( 5 )

Q

Which command is used to login a MySQL database?

A

Login MySQL database by using following command
# mysql -u root -p

Q

What are all the packages to install a LAMP server?

A

You can install the packages of lamp server by following commands
# apt-get install apache2 php5 php5-mysql mysql-client mysql-server libapache2-mod-php5 php5-gd php5-curl libssh2-php -y

Q

How to download Drupal in ubuntu?

A

Download the packages of drupal by following commands
# wget https://ftp.drupal.org/files/projects/drupal-8.1.1.tar.gz--2016-05-06 15:48:59-- https://ftp.drupal.org/files/projects/drupal-8.1.1.tar.gz

Q

How to configure drupal in centos?

A

configure drupal in centos by following link
https://www.linuxhelp.com/how-to-install-drupal-in-centos/

Q

How to install the Drupal package in Ubuntu?

A

Install the Drupal package in Ubuntu by following commands

# apt-get install drupal7 drush

Related Tutorials in How to Install Drupal in Debian / Ubuntu

Related Tutorials in How to Install Drupal in Debian / Ubuntu

How to install Drupal on CentOS web panel
How to install Drupal on CentOS web panel
Aug 26, 2017
How to install Drupal CMS 8.6.1 on MX Linux 17
How to install Drupal CMS 8.6.1 on MX Linux 17
Nov 19, 2018
How to install Drupal 8.5.3 on Ubuntu 18.04
How to install Drupal 8.5.3 on Ubuntu 18.04
Jun 26, 2018
How To Install Drupal CMS On Linuxmint 19
How To Install Drupal CMS On Linuxmint 19
Nov 29, 2019
How to install Drupal CMS on Ubuntu 22.04
How to install Drupal CMS on Ubuntu 22.04
Nov 4, 2023
How to Install Drupal CMS on Linux Mint 20
How to Install Drupal CMS on Linux Mint 20
Sep 1, 2021
How to install Drupal CMS – 8.5.0 on Ubuntu – 17.04
How to install Drupal CMS – 8.5.0 on Ubuntu – 17.04
May 8, 2018
How to Install Drupal in Debian / Ubuntu
How to Install Drupal in Debian / Ubuntu
May 13, 2016
Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Isaac ?
How to run windows application in linux

I need to run the windows application in my Linux machine, instead of installing from yum repo or any other repos. How to do that..??

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.