How to Install Drupal in Debian / Ubuntu
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
Re-enter to confirm the password.
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
Now choose your language and click save and continue.
Now select the installation profile of your choice and click save and continue.
Now enter the details to configure database and click save and continue.
The drupal installation starts as shown below.
After installation, enter the details to configure your site.
Select the country and time zone. Click save and continue
Now the home page for the site appears as shown below.
We can add the content for the site by clicking ' Add content' .
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.
Now click save and publish to publish the site to drupal’ s home page.
The site appears inside the drupal home page as shown below.
Comments ( 0 )
No comments available