Install DRUPAL & create your own Website/Blog

存储架构 2018-02-15

Drupal is a free and open source content management system. Drupal aka Drupal core can server as a website, a single or multi-user blog, or even can be used as a forum. Drupal offer a sophisticated API for developers but its basic website installation & administration requires no programming knowledge.

Drupal can run on any operating system that supports a web server with PHP & a database. So Drupal can be installed on Windows machine, Linux or Mac OS. Drupal provides a number of featured like user account registration and maintenance, menu management, RSS feeds, taxonomy, page layout customization etc.

In this tutorial, we will learn to install Drupal 8.4.0 on Linux machines. So let’s start with pre-requisites..

(Recommended Read: WordPress Installation on CentOS/RHEL )

(Also Read: Create your website with Joomla )

Pre-requisites

->Drupal requires LAMP installed on systems, so we should have one ready. We have already covered LAMP installation on CentOS/RHEL & Ubuntu , so refer to these articles to install LAMP server (Install PHP from the below mentioned tutorial).

->PHP 7 is required. If you are using older version of PHP i.e. 5XXX, than you need to install/upgrade the PHP to php 7. Install the php 7, run the following command to install php 7 onto your system,

$ sudo yum install -y http://dl.iuscommunity.org/pub/ius/stable/CentOS/7/x86_64/ius-release-1.0-14.ius.centos7.noarch.rpm

$ sudo yum -y install php70u php70u-pdo php70u-mysqlnd php70u-opcache php70u-xml php70u-mcrypt php70u-gd php70u-devel php70u-intl php70u-mbstring php70u-bcmath php70u-json php70u-iconv

Also go through the detailed tutorial to upgrade the php on your machine.

Installation

Once we have our LAMP server ready, we can start he installation of Drupal. We will first grab latest version of Drupal, which at the time of writing this article is 8.4.0. Use the following command to download the tar package,

$ wget https://ftp.drupal.org/files/projects/drupal-8.4.0.tar.gz

Now extract the package,

$ tar -xvf drupal-8.4.0.tar.gz

& copy all its content to ‘var/www/html/’,

$ cd drupal-8.4.0

$ mv * /var/www/html

Configuring MySql

Next we will create a database for Drupal to use, to store the data on. Login to MySql & create the database,

$ mysql -u root -p -e “CREATE DATABASE drupaldb CHARACTER SET utf8 COLLATE utf8_general_ci”

Next create a user for accessing ‘drupaldb’;

$ mysql -u root -p

mysql> create user[email protected] identified by ‘drupalpasswd’;

Now grant privileges to the user,

mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON drupaldb.* TO ‘drupaluser’@’localhost’ IDENTIFIED BY ‘drupalpasswd’;

Now, implement the changes made to db with following command;

mysql> flush privileges;

than exit the database,

mysql> exit

We now have our DB & DB user ready. Same process is to be done, if using MariaDB instead of MySql server.

Configuring Apache

Now we will make some changes to apache server. We will enable rewrite functionality for the web server as this will allow Drupal to modify URLs to human friendly strings. Enable mod_rewrite in CentOS machines by adding following line to httpd.conf,

$ vim /etc/httpd/conf/httpd.conf

LoadModule rewrite_module modules/mod_rewrite.so

For Ubuntu machines, open terminal & run the following command to enable mod_rewrite,

$ sudo a2enmod rewrite

Next we will allow the use of .htaccess file for Drupal installation. Open the file where you have mentioned the virtual host entries, it can be one of the following files,

/etc/httpd/conf/httpd.conf (for Centos)

/etc/apache2/apache2.conf (for Ubuntu)

or it can be custom host config file like

/etc/apche2/sites-available/website.conf

or /etc/apache2/sites-enabled/000-default.conf

Make the following entry to the file you are using to define virtual hosts,

For Apache 2.2

ServerName drupal-test.com

ServerAdmin[email protected]

DocumentRoot /var/www/html

Options FollowSymlinks

AllowOverride All

For Apache 2.4

ServerName drupal-test.com

ServerAdmin[email protected]

DocumentRoot /var/www/html

Options FollowSymlinks

AllowOverride All

Require all granted

Now save the file & exit. Next restart the service to implement the changes.

$ service apache2 restart (For Ubuntu)

$ service httpd restart (For CentOS)

Installing Drupal

We will start the Drupal installation, but first copy the default settings file and rename the duplicate. Do not rename the default file as we require both files for the Drupal installation.

$ cd /var/www/html/sites/default

$ cp default.settings.php settings.php

$ cp default.services.yml services.yml

Now modiy the permissions of the file, so that it has writer permssions,

$ chmod 666 settings.php services.yml

We also need to create a folder named ‘files’ in the same directoru i.e. /var/www/html/sites/default/

$ mkdir files

Now, open the web-browser & enter the following URL to start the Drupal installation,

http://drupal-test.com

Setup will start as soon as the page is loaded, follow the on screen steps to install Drupal. On the first screen, we need to select the language & continue,

On the next screen, select the profile. We are using the default profile i.e. standard,

On this screen, setup will review the requirements & will provide the errors or warnings that are needed to resolved to proceed with the setup,

Resolve any error & click continue to move further. On the next screen, we need to enter the database details,

Upon pressing ‘Save and continue’, installation will now start,

After the installation has been completed, we will be directed to configuration screen. Make the configurations as needed & proceed further,

Congratulations, we have now configured our website with Drupal.

LXer

责编内容by:LXer (源链)。感谢您的支持!

您可能感兴趣的

Ted Dunning, Ellen Friedman: Time Series Databases In the recent Humble Book Bundle , I’ve noticed a quite short Time Series Databases by Ted Dunning...
微软、IBM、英特尔、三星、红帽欢迎谷歌入群,怎么来了一条狗?... (题图照片:2017年10月摄于丹佛共享办公楼SPACES。) 2017年10月4日到6日, Node.js北美互动会 在温哥华胜利召开。在这次团结的大会上, 谷歌 正式成为No...
Hr-Papers–宽字节注入深度讲解 原理介绍 基本概概念 宽字节是相对于ascII这样单字节而言的;像GB2312、GBK、GB18030、BIG5、Shift_JIS等这些都是常说的宽字节,实际上只有两字节 ...
Postback fails on default document So I've created a Web Application (not Web Site) with ASP.NET (C#) and it compiles just fine in the...
合格的配置中心应有的素养 最近在看配置中心的一些设计,好像基本都是五花八门,主要看的是还是携程的 Apollo 这个开源的配置中心项目。一直以来都觉得配置中心很重要,因为这对于灰度发布,线上实施干预都有非常重大的作用。但是嘛,...