How To Install Backdrop CMS v1.12.6 on Ubuntu 18.04 LTS

Install Backdrop CMS on Ubuntu 18

Backdrop CMS is a full-featured content management system that allows non-technical users to manage a wide variety of content. It can be used to create all kinds of websites including blogs, image galleries, social networks, intranets, and more.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Backdrop CMS on an Ubuntu 18.04 Bionic Beaver server.

Install Backdrop CMS on Ubuntu 18.04 LTS

Step 1. First make sure that all your system packages are up-to-date

sudo apt-get update
sudo apt-get upgrade

Step 2. Install LAMP (Linux, Apache, MariaDB and PHP) server.

A Ubuntu 18.04 LAMP server is required. If you do not have LAMP installed, you can follow our guide here. Also install all required PHP modules:

apt-get install php7.1-cli php7.1-mbstring php7.1-gd php7.1-opcache php7.1-mysql php7.1-json php7.1-mcrypt php7.1-xml php7.1-curl

Step 3. Installing Backdrop CMS on Ubuntu 18.04 LTS.

First thing to do is to go to Backdrop CMS’s download page and download the latest stable version of Backdrop CMS, At the moment of writing this article it is version v1.10.1:

wget https://github.com/backdrop/backdrop/releases/download/1.10.1/backdrop.zip

Unpack the Backdrop archive to the document root directory on your server:

unzip backdrop.zip
mkdir -p /var/www/html
mv backdrop /var/www/html

We will need to change some folders permissions:

chown -R www-data:www-data /var/www/html/backdrop/

Step 4. Configuring MariaDB for Backdrop CMS.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. You should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB.

mysql_secure_installation

Configure it like this:

- Set root password? [Y/n] y
- Remove anonymous users? [Y/n] y
- Disallow root login remotely? [Y/n] y
- Remove test database and access to it? [Y/n] y
- Reload privilege tables now? [Y/n] y

Next we will need to log in to the MariaDB console and create a database for the Backdrop CMS. Run the following command:

mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for Backdrop CMS installation:

MariaDB [(none)]> CREATE DATABASE backdropdb character set UTF8;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON mahara.* TO 'backdropuser'@'localhost' IDENTIFIED BY 'your-password';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q

Step 5. Configuring Apache web server for Backdrop CMS.

Create a new virtual host directive in Apache. For example, create a new Apache configuration file named ‘backdrop.conf’ on your virtual server:

touch /etc/apache2/sites-available/backdrop.conf
ln -s /etc/apache2/sites-available/backdrop.conf /etc/apache2/sites-enabled/backdrop.conf
nano /etc/apache2/sites-available/backdrop.conf

Add the following lines:

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/var/www/html/backdrop/"
ServerName your-domain.com
ServerAlias www.your-domain.com
<Directory "/var/www/html/backdrop/">
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/your-domain.com-error_log
CustomLog /var/log/apache2/your-domain.com-access_log common
</VirtualHost>

Now, we can restart Apache web server so that the changes take place:

sudo a2enmod rewrite
a2ensite backdrop.conf
systemctl restart apache2.service

Step 6. Accessing Backdrop content management system.

Backdrop CMS will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://yourdomain.com or http://server-ip and complete the required the steps to finish the installation. If you are using a firewall, please open port 80 to enable access to the control panel.

Congratulation’s! You have successfully installed Backdrop CMS. Thanks for using this tutorial for installing Backdrop CMS (content management system) on your Ubuntu 18.04 LTS (Bionic Beaver) system. For additional help or useful information, we recommend you to check the official Backdrop CMS Installation guide.

How To Install R on Ubuntu 18.04 LTS

Install R on Ubuntu 18

R is a popular open source programming language, often use for graphical and statistical computing. It is supported by the R Foundation for Statistical Computing and mainly used by statisticians and data miners for developing statistical software and performing data analysis.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation R open source programming language on an Ubuntu 18.04 Bionic Beaver server.
Install R on Ubuntu 18.04 LTS Bionic Beaver

Step 1. First make sure that all your system packages are up-to-date

sudo apt-get update
sudo apt-get upgrade

Step 2. Installing R on Ubuntu 18.04 LTS.

First, add GPG Keys with following command. GPG Keys maintain package consistency and authenticity by requiring that distributors sign packages with GPG key:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9

Next, add R official repository source:

sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'

Now we can install R using command:

sudo apt-get update
sudo apt install r-base

To verify that the installation was successful run the following command which will print the R version:

R --version

Step 3. Installing R packages.

For installing a CRAN package in R we use install.pacakges() function. This command fetches package from specified repository and install on your computer:

### Example ###
install.packages("ggplot2")

You can check whether a particular package is installed or not by using packageVersion function:

packageVersion("ggplot2")

Congratulation’s! You have successfully installed R. Thanks for using this tutorial for installing R open source programming language on your Ubuntu 18.04 LTS Bionic Beaver. For additional help or useful information, we recommend you to check the official R web site.

How To Install LEMP on Ubuntu 18.04 LTS

Install LEMP on Ubuntu 18

A LEMP software stack is a group of open source software that is typically installed together to enable a server to host dynamic websites and web apps. This term is actually an acronym which represents the Linux operating system, with the Nginx web server (which replaces the Apache component of a LAMP stack). The site data is stored in a MySQL database (using MariaDB), and dynamic content is processed by PHP.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation LEMP stack (Linux, Nginx, MariaDB and PHP) on an Ubuntu 18.04 Bionic Beaver server.

Install LEMP on Ubuntu 18.04 LTS

Step 1. First make sure that all your system packages are up-to-date

sudo apt-get update
sudo apt-get upgrade

Step 2. Installing Nginx on Ubuntu 18.04 LTS.

Install Nginx with apt, which is the default package manager for Ubuntu:

sudo apt install nginx

Once installed, start Nginx service using the following command:

sudo systemctl start nginx

Now if you have your UFW firewall running, you will need to allow connections to Nginx:

sudo ufw allow 'Nginx HTTP'

You can verify that Nginx is really running by opening your favorite web browser and entering the URL http://your-domain.com, if it is installed, then you will see this:Install LEMP on Ubuntu 18.04 LTS

nginx-default-page

To get Nginx to work with PHP correctly, we need to make changes to the Nginx configuration file. This guide we will be using a simple Nginx config file:

sudo nano /etc/nginx/sites-available/default

Copy the following into your text editor:

    server {
            listen       80;
            server_name  your_domain_name.com;
            root /usr/share/nginx/html;
            index index.php index.html;
            location / {
                    try_files $uri $uri/ =404;
            }
            error_page 404 /404.html;
            error_page 500 502 503 504 /50x.html;
            location = /50x.html {
                    root /var/www/html;
            }
            location ~ \.php$ {
                    try_files $uri =404;
                    fastcgi_pass unix:/var/run/php7.2-fpm.sock;
                    fastcgi_index index.php;
                    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                    include fastcgi_params;
            }
    }

Once you have finished editing the file restart Nginx with:

sudo nginx -t
sudo systemctl restart nginx

Step 4. Installing MariaDB on Ubuntu 18.04 LTS.

To install MariaDB in Ubuntu 18.04 run the following command:

sudo apt install mariadb-server

Once complete, you can verify MariaDB is installed by running the below command:

sudo systemctl status mariadb

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. you should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:

mysql_secure_installation

Configure it like this:

- Set root password? [Y/n] y
- Remove anonymous users? [Y/n] y
- Disallow root login remotely? [Y/n] y
- Remove test database and access to it? [Y/n] y
- Reload privilege tables now? [Y/n] y

To log into MariaDB, use the following command (note that it’s the same command you would use to log into a MariaDB database):

mysql -u root -p

Step 5. Installing PHP and Configure PHP-FPM Settings.

Unlike Apache, Nginx does not contain native PHP processing. For that we have to install PHP-FPM (FastCGI Process Manager):

sudo apt install php-fpm php-mysql

Once installed, check the PHP version:

php --version

Now open the PHP-FPM default file to edit the following content:

### nano /etc/php/7.2/fpm/php.ini
cgi.fix_pathinfo=0
date.timezone = Africa/Douala

Save the file and restart php-fpm:

systemctl restart php7.2-fpm

To test PHP, create a test file named info.php with he content below. Save the file, then browse to it to see if PHP is working:

nano /usr/share/nginx/html/info.php

Copy the following into your text editor:

<?php
phpinfo();
?>

Try to access it at http://your_server_ip/info.php . If the PHP info page is rendered in your browser then everything looks good and you are ready to proceed further.

nginx-php7.2

Congratulation’s! You have successfully installed LEMP stack. Thanks for using this tutorial for installing LAMP (Linux, Nginx, MySQL and PHP) in Ubuntu 18.04 LTS system.

How To Install Apache Maven 3.6.1 on Ubuntu 18.04 LTS

Install Apache Maven on Ubuntu 18

Apache Maven is a free and open source project management tool used for Java projects. You can easily handle a project’s build, reporting, and Documentation from a central piece of advice using Apache Maven. Apache Maven provides a complete framework to automate the job’s Build infrastructure.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Apache Maven open source data visualization and monitoring suite on a 18.04 LTS (Bionic Beaver) server.

Install Apache Maven on Ubuntu 18.04 LTS

Step 1. First make sure that all your system packages are up-to-date

sudo apt-get update
sudo apt-get upgrade

Step 2. Installing Java.

Apache Maven requires Java to be installed on your server. By default, Java is not available in Ubuntu’s repository. Add the Oracle Java PPA to Apt with the following command:

add-apt-repository ppa:webupd8team/java
apt-get update -y
apt-get install oracle-java8-installer

Verify the Java version by running the following command:

java -version

Step 3. Installing Apache Maven on Ubuntu 18.04 LTS.

First thing to do is to go to Apache Maven’s download page and download the latest stable version of Apache Maven, At the moment of writing this article it is version 3.5.4:

wget http://www-eu.apache.org/dist/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz

Now extract downloaded archive using following command:

tar xzf apache-maven-3.5.4-bin.tar.gz
ln -s apache-maven-3.5.4 apache-maven

Step 4. Setup Environment Variables.

Now set the environments variables by creating new file /etc/profile.d/maven.sh:

nano /etc/profile.d/apache-maven.sh

Add following content:

export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export M2_HOME=/usr/local/apache-maven
export MAVEN_HOME=/usr/local/apache-maven
export PATH=${M2_HOME}/bin:${PATH}

Then, Provide the following commands to make maven.sh executable and reload i:

sudo chmod +x maven.sh
source maven.sh

Step 5. Verify Installation.

Once everything has been successfully configured, check the version of the Apache Maven:

### mvn -version

Apache Maven 3.5.4 (138edd61fd1BMWe468bfa2d307c43b76940a5d7d; 2018-6-18T13:28:13+05:30)
Maven home: /usr/local/apache-maven
Java version: 1.8.0_144, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-46-generic", arch: "amd64", family: "unix"

Congratulation’s! You have successfully installed Apache Maven. Thanks for using this tutorial for installing Apache Maven on Ubuntu 18.04 LTS (Bionic Beaver) system. For additional help or useful information, we recommend you to check the official Apache Maven web site.

How To Install Jenkins on Ubuntu 18.04 LTS

Install Jenkins on Ubuntu 18

Jenkins is an open source continuous integration tool written in Java. Jenkins provides continuous integration services for software development. It is a server-based system running in a servlet container such as Apache Tomcat. It supports SCM tools including AccuRev, CVS, Subversion, Git, Mercurial, Perforce, Clearcase and RTC, and can execute Apache Ant and Apache Maven based projects as well as arbitrary shell scripts and Windows batch commands.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Apache Kafka on a 18.04 LTS (Bionic Beaver) server.

Install Jenkins on Ubuntu 18.04 LTS

Step 1. First make sure that all your system packages are up-to-date

sudo apt-get update
sudo apt-get upgrade

Step 2. Installing Java.

Jenkins requires Java to be installed on your server. By default, Java is not available in Ubuntu’s repository. Add the Oracle Java PPA to Apt with the following command:

sudo add-apt-repository ppa:webupd8team/java
sudo apt install oracle-java8-installer
sudo apt install oracle-java8-set-default

Verify the Java version by running the following command:

java -version

Step 3. Installing Jenkins on Ubuntu 18.04 LTS.

Add the key and source list to apt:

wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
sudo apt-add-repository "deb https://pkg.jenkins.io/debian-stable binary/"

Now, start proceed installation Jenkins:

sudo apt-get update
sudo apt-get install jenkins

Start Jenkins service:

systemctl start jenkins

Jenkins will write log files to /var/log/jenkins/jenkins.log. You can also fine-tune the configuration.

Step 4. Installing and Configure Apache web server for Jenkins.

Install Apache web server on your system:

apt-get install apache2

Create a new virtual host directive in Apache. For example, create a new Apache configuration file named ‘jenkins.conf’ on your virtual server:

a2enmod proxy
a2enmod proxy_http
a2ensite jenkins
touch /etc/apache2/sites-available/jenkins.conf
ln -s /etc/apache2/sites-available/jenkins.conf /etc/apache2/sites-enabled/jenkins.conf
nano /etc/apache2/sites-available/jenkins.conf

Add the following lines:

<Virtualhost *:80>
    ServerName        my.jenkins.id
    ProxyRequests     Off
    ProxyPreserveHost On
    AllowEncodedSlashes NoDecode

    <Proxy http://localhost:8080/*>
      Order deny,allow
      Allow from all
    </Proxy>

    ProxyPass         /  http://localhost:8080/ nocanon
    ProxyPassReverse  /  http://localhost:8080/
    ProxyPassReverse  /  http://my.jenkins.id/
</Virtualhost>

Save and close the file. Restart the apache and jenkins service for the changes to take effects:

systemctl restart apache2
systemctl restart jenkins

Step 5. Accessing Jenkins.

Jenkins will be available on HTTP port 8080 by default. Open your favorite browser and navigate to http://yourdomain.com:8080 or http://server-ip:8080 and complete the required the steps to finish the installation. If you are using a firewall, please open port 8080 to enable access to the control panel. Default installation password can be found at /var/lib/jenkins/secrets/initialAdminPassword as showing in below image.

How To Install Apache Spark 2.4.1 on Ubuntu 18.04 LTS

Install Apache Spark on Ubuntu 18

Apache Spark is a fast and general-purpose cluster computing system. It provides high-level APIs in Java, Scala and Python, and also an optimized engine which supports overall execution charts. It also supports a rich set of higher-level tools including Spark SQL for SQL and structured information processing, MLlib for machine learning, GraphX for graph processing, and Spark Streaming.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Apache Spark on a 18.04 LTS (Bionic Beaver) server.

Install Apache Spark on Ubuntu 18.04 LTS

Step 1. First make sure that all your system packages are up-to-date

sudo apt-get update
sudo apt-get upgrade

Step 2. Installing Java.

Apache Spark requires Java to be installed on your server. By default, Java is not available in Ubuntu’s repository. Add the Oracle Java PPA to Apt with the following command:

add-apt-repository ppa:webupd8team/java
apt-get update -y
apt-get install oracle-java8-installer

Verify the Java version by running the following command:

java -version

Step 3. Installing Apache Spark on Ubuntu 18.04 LTS.

Install Apache Spark using following command:

wget https://www.apache.org/dyn/closer.lua/spark/spark-2.3.1/spark-2.3.1-bin-hadoop2.7.tgz
tar xvzf spark-2.3.1-bin-hadoop2.7.tgz
ln -s spark-2.3.1-bin-hadoop2.7 spark

Adding Spark to Path:

nano ~/.bashrc
[php]


Next, add these lines to the end of the .bashrc file so that path can contain the Spark executable file path:
[php]
SPARK_HOME=/idr00t/spark
export PATH=$SPARK_HOME/bin:$PATH

To activate these changes, run the following command for bashrc file:

source ~/.bashrc

Launching Spark Shell:

./spark/bin/spark-shell

Step 4. Accessing Apache Spark.

Apache Spark will be available on HTTP port 4040 by default. Open your favorite browser and navigate to http://yourdomain.com:4040 or http://server-ip:40404 and complete the required the steps to finish the installation.

spark-web-console

Congratulation’s! You have successfully installed Apache Spark. Thanks for using this tutorial for installing Apache Spark on Ubuntu 18.04 LTS (Bionic Beaver) system. For additional help or useful information, we recommend you to check the official Apache Spark Documentation.

How To Install Apache Kafka on Ubuntu 18.04 LTS

Install Apache Kafka on Ubuntu 18

Apache Kafka is a distributed message agent designed to deal with huge volumes of real time information effectively. Unlike traditional agents like ActiveMQ and RabbitMQ, Kafka functions as a bunch of one or more servers that makes it highly scalable and because of the distributed nature, it’s inbuilt fault-tolerance whilst providing greater throughput when compared to its counterparts.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Apache Kafka on a 18.04 LTS (Bionic Beaver) server.

Install Apache Kafka on Ubuntu 18.04 LTS

Step 1. First make sure that all your system packages are up-to-date

sudo apt-get update
sudo apt-get upgrade

Step 2. Installing Java.

Apache Spark requires Java to be installed on your server. By default, Java is not available in Ubuntu’s repository. Add the Oracle Java PPA to Apt with the following command:

add-apt-repository ppa:webupd8team/java
apt-get update -y
apt-get install oracle-java8-installer

Verify the Java version by running the following command:

java -version

Step 3. Installing Zookeeper.

Apache Kafka depends on Zookeeper for cluster management. Hence, prior to starting Kafka, Zookeeper has to be started:

apt-get install zookeeperd

After the installation completes, ZooKeeper will be started as a daemon automatically. By default, it will listen on port 2181:

netstat -ant | grep :2181

You can run the following command to check whether zookeeper is running:

systemctl status zookeeper

Step 4. Download and Installing Apache Kafka on Ubuntu 18.04 LTS.

First, download and extract Kafka from Apache website. You can use wget to download Kafka:

wget http://www-us.apache.org/dist/kafka/1.1.0/kafka_2.12-1.1.0.tgz

Then extract the archive file:

tar xzf kafka_2.12-1.1.0.tgz
mv kafka_2.12-1.1.0 /usr/local/kafka

Start Kafka Server:

cd /usr/local/kafka
bin/zookeeper-server-start.sh config/zookeeper.properties

Now start the Kafka server:

bin/kafka-server-start.sh config/server.properties

...
[2018-06-26 10:59:45,989] INFO Kafka version : 1.0.1 (org.apache.kafka.common.utils.AppInfoParser)
[2018-06-26 10:59:45,995] INFO Kafka commitId : c0518aa65f25317e (org.apache.kafka.common.utils.AppInfoParser)
[2018-06-26 10:59:46,006] INFO [KafkaServer id=0] started (kafka.server.KafkaServer)
 Step 5. Create a Topic on Kafka.

Let’s create a topic named “NewTopic” with a single partition and only one replica:

bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic NewTopic
Created topic "NewTopic".

Now you can see the created topic on Kafka by running the list topic command:

bin/kafka-topics.sh --list --zookeeper localhost:2181
NewTopic

Step 6. Send Messages to Kafka.

The “producer” is the process responsible for put data into our Kafka. The Kafka comes with a command line client that will take input from a file or from standard input and send it out as messages to the Kafka cluster:

Let’s run the producer and then type a few messages into the console to send to the server:

bin/kafka-console-producer.sh --broker-list localhost:9092 --topic NewTopic


>Welcome to kafka
>This is my new topic
>

Step 7. Using Kafka Consumer.

Kafka also has a command line consumer to read data from Kafka cluster and display messages to standard output:

bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic NewTopic --from-beginning

Welcome to kafka
This is my new topic

Congratulation’s! You have successfully installed Apache Kafka. Thanks for using this tutorial for installing Apache Kafka on Ubuntu 18.04 LTS (Bionic Beaver) system. For additional help or useful information, we recommend you to check the official Apache Kafka Documentation.