Skip to main content

How i installed Drupal 8 on Ubuntu 16.04

Drupal 7 or Drupal 8?

With some research, I had an idea on which Drupal version to opt for. I got to know that D7 is more documented and actually has more modules than D8 whereas D8 is more user-friendly with improved editing flexibility but with some modules not ported yet. Finally, I decided to give a chance to the latest Drupal version. As a beginner, I do not think I will need to work with advanced modules. Therefore in this step by step document, we will be installing Drupal 8!

Step 1: Make sure everything is up to date

First, I made sure all of my system packages are up to date by running the following commands. Using sudo su was very useful for not to waste time entering the same password again and again.
sudo su
sudo apt-get update
sudo apt-get upgrade

Step 2: Install LAMP(Linux, Apache, Mysql, Php)

Using Tasksel allowed me to install all packages LAMP server contain. During the process, I had to enter a password for Mysql. This password was found to be needed later on. Commands:
sudo apt-get install tasksel
sudo tasksel install lamp-server

mysql
The password will be used later on. Sooo it's worth taking note.
Optional: I tested if Apache is working by going to my web browser and search "localhost". A similar web page appeared.

Installing Php extensions:

I actually missed some extensions and had some problems later on. Here's the correct way to do it:
sudo apt-get install php7.0 php7.0-mysql php7.0-gd php7.0-curl libapache2-mod-php7.0 php7.0-mbstring php7.0-xml nginx mysql-server php7.0-fpm php7.0-mcrypt

//if nginx is not installing, just run sudo service apache2 stop before running the command and sudo service apache2 start after.

Enable clean URLs on Apache:

I did not do this step correctly and had a warning later on. To me, vim was kind of tricky to use but ended up finding it pretty easy at the end. That is, press i for editing mode, esc for normal mode, :x to save and quit. Without sudo command, it was found to be unwritable. The correct command was:
sudo vim /etc/apache2/apache2.conf

Then, I scrolled down till
<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>
   


and changed the None to All as shown above. I finished up by restarting apache with: sudo service apache2 restart

Optional: Once LAMP was installed, it was easy to check if Php was correctly configured by entering these terminal commands one after the other.

sudo nano /var/www/html/test.php
<?php phpinfo(); ?>

I was then able to go to 'localhost/test.php' on my browser. Therefore Php was configured correctly!

Step 3: Install Drupal 8

From https://www.drupal.org/project/drupal/releases, I took the download link location of the latest release of Drupal. For instance, here it is "https://ftp.drupal.org/files/projects/drupal-8.2.3.tar.gz"



From terminal, I installed Drupal from the copied link location
wget https://ftp.drupal.org/files/projects/drupal-8.2.3.tar.gz

Once done, I then 1) extracted the file,
tar -xvzf drupal-8.2.3.tar.gz


2) created a root directory for Drupal,
mkdir /var/www/html/drupal

3) moved Drupal files to localhost,
mv drupal-8.2.3/* drupal-8.2.3/.htaccess /var/www/html/drupal

4) created some file directories for Drupal,
mkdir /var/www/html/drupal/sites/default/files

5) changed permission of these new directories so that Drupal can access it,
sudo chown www-data:www-data /var/www/html/drupal/sites/default/files

6) created a Drupal configuration file,
sudo cp /var/www/html/drupal/sites/default/default.settings.php /var/www/drupal/sites/default/settings.php

7) changed access authorization of the Drupal configuration file for Drupal.
sudo chown www-data:www-data /var/www/html/drupal/sites/default/settings.php

Step 4: Create a database and user for drupal 8

I then logged into MariaDB shell as root and proceeded by setting up a database name, username and password.
Here is how,
mysql -u root -p
create database [database name];
create user [drupaluser]@localhost;
set password for [drupaluser]@localhost= password["your-password"];
grant all privileges on [database name].* to [drupaluser]@localhost identified by 'your-password';
flush privileges;
exit;

Step 5: Finish Drupal installation on my web browser!

I went the setup page using the place where I installed Drupal files (it could be an IP address, localhost or a domain name) followed by /drupal.
For example, it could be 170.12.0.16/drupal or, in my case, simply localhost/drupal.

Then I was to choose my preferred language, which was English.
Right after, I was able to select my profile.Being a beginner, I preferred the Standard choice over the minimal one.

Then, coming to requirements verification, in my case, I had 2 errors.
To resolve this, I just installed any missing extension. For e.g:
sudo apt-get install php7.0-gd [As gd extension was missing]

Followed by reinstalling some extensions
sudo apt-get install --reinstall php-common php-mysql

and reloading apache.
sudo /etc/init.d/apache2 reload

Concerning the clean URLs, the solution was then found. (Step 2)

Then, for database set up, previous database name, username and passwords were needed.

It should then proceed to 40 Drupal core modules installation.

Finally, I was to fill the site maintenance account & site information. In fact, these can be re-configured again if needed on the Drupal main page!

Here is how I installed Drupal 8 on Ubuntu 16.04!
* To me, the hardest part was to configure Apache and install the missing Php extensions. They took me quite some time and research. In the end, the process was wonderful as it made me acquire some terminal commands and Ubuntu knowledge while discovering Drupal at the same time.

Thank you for reading my blog!
Comments and suggestions are always welcome. 😃





 

 

 



Comments

Popular posts from this blog

IETF 102 - Implementing TLSv1.3 to Nagios Remote Plugin Executor (NRPE)

Hey there, welcome back to another blog post. In this one, I will document my experience in implementing TLSv1.3 to Nagios Remote Plugin Executor (NRPE) for the IETF 102 Hackathon. Rahul and I paired up for this task. In the last hackathon, he implemented TLS 1.3 in the check_http Nagios plugin (PR#368) and was quite familiar with Nagios already.
What are Nagios and NRPE? In short, Nagios monitors systems, networks and infrastructure. It alerts users when things go wrong and warn them again when the problem has been resolved. NRPE, as the name tells, allows the user to be able to execute Nagios Plugins remotely.


The encryption part between check_nrpe and NRPE security protocol could only support up to TLSv1.2.
How we made it? On the first day, we quickly set up our virtual machines, cloning the NRPE repo and going through the code. Everything went fine. The testing part was a little bit more tricky but at the end, we made it through even if Rahul was pretty sick.



Then... we finally go…

Write 3-paragraph essay to explain what is Drupal to grandpa/grandma.

Drupal is surely unknown to the elders. When asking “What is Drupal?” nothing would come to their mind. As grandpa and grandma are not into the tech world, it would be hard for them to understand what Drupal is right away. Let's take this short scenario as an example: Grandpa is a philosopher. He is pretty fed up with all the procedures and investment needed before getting his work published. Instead, grandpa now wants to create a personal blog online. Yet, he thinks that it is out of his reach and gets discouraged. That is when Drupal pops in to tackle grandpa's query.  With Drupal, he can create a website online without much technical knowledge. Basically, Drupal is just like a simple Microsoft word office. The main difference, it gets your content further by publishing your 'document' on the net. Likewise, Drupal allows grandpa to edit, manage and publish his writings. All this, only by accessing the internet. Thus, grandpa can also add pictures, increase text sizes …

Set up Drupal with Docker

In short, Docker is an open source tool that allows the use of containers. Containers consist of predefined lines of code built by the community. Anyone can push his docker file for other people to use. Of course, Docker has a lot more functionality that I just mentioned: mounting volumes, linking containers and so on. In this blog, I will document my little experience on setting up a full Drupal Development Environment!

As usual, Google search engine was my hero. I came up with many tutorials which helped me to get started with Docker.
Step 0: Install Docker At first, this step was confusing... docker commands were known for its long commands. Mainly due to flags. But hopefully, I only had to follow the steps command by command!
Step 1: Set up Drupal Development Environment1.1. To start with, a database was needed for local development. In this command, I run a database from the MariaDB image, put 'drupal' as database password and named the container 'drupaldock'
docker…

Finish Entire Drupal Ladder [Git Basics]

Getting Started with Git At first, Drupal ladder introduced a little Git introduction and the benefits of its usage. It was fascinating. I knew it would help me in the future. There were three links: http://try.github.com/levels/1/challenges/1, http://pcottle.github.com/learnGitBranching, and http://git-scm.com/book. Both three were useful to understand Gits tree structure.
Install Git Coming to Git installation, I had to put some git commands into practice: git show, git log, git branch, git status among others. As it was something new to me, I took some time to grasp all the commands. Its installation was pretty easy; I only had to follow Drupal Ladder's steps.
Write a patch Before starting, I had to learn two of the prerequisites: getting used with the issue queue and Drupal sandbox. I had no problem hosting Drupal sandbox and creating an issue. Coming to the main step, I had to generate and submit a patch. Here are the proposed patch and screenshot. It was fantastic seeing how th…