How to Install Deluge BitTorrent Client on Ubuntu 18.04

Install Deluge BitTorrent Client on Ubuntu 18.04

In this tutorial we are going to learn how to install Deluge BitTorrent Client on Ubuntu 18.04. We will also install and configure its prerequisites. Deluge is a free, open-source (GPL3) and lightweight BitTorrent client, available for Linux, FreeBSD, Mac OS X and Windows. It has a rich collection of plugins that you can install to extend its functionality.

I recommend to use a minimal Ubuntu server setup as a basis for the tutorial, that can be a virtual or a root server image with an Ubuntu 18.04 Bionic Beaver minimal install from a web hosting company or you use our minimal server tutorial to install a server from scratch.

Install Deluge BitTorrent Client on Ubuntu 18.04

Step 1. First, ensure your system and apt package lists are fully up-to-date by running the following:

apt-get update -y
apt-get upgrade -y

Step 2. Installing Deluge BitTorrent Client on Ubuntu 18.04.

The ​Deluge PPA contains the latest Deluge releases for Ubuntu:

sudo add-apt-repository ppa:deluge-team/ppa

Install Deluge using following command:

sudo apt update
sudo apt install deluged deluge-webui

Once installed, open the Deluge Torrent Client from Ubuntu Dash or open the terminal and typing following command:

deluged

Congratulation’s! You have successfully install and configured Deluge BitTorrent Client on your Ubuntu 18.04 server. Thanks for using this tutorial installing Deluge BitTorrent Client on Ubuntu 18.04 LTS (Bionic Beaver) system.

How to Install PHP 7 on Debian 9

Install PHP 7 on Debian 9

In this tutorial we are going to learn how to install PHP 7 on Debian 9. We will also install and configure its prerequisites. The PHP Hypertext Preprocessor (PHP) is a programming language that allows web developers to create dynamic and interactive Web pages. As of 2018, PHP was used as the server-side programming language on 85% of 10 million most popular websites

I recommend to use a minimal Ubuntu server setup as a basis for the tutorial, that can be a virtual or a root server image with an Debian 9 Stretch minimal install from a web hosting company or you use our minimal server tutorial to install a server from scratch.

Install PHP 7 on Debian 9

Step 1. First, before we install packages, it’s a good idea to update repository and software packages. Run the following command on your Debian 9 OS:

sudo apt update
sudo apt upgrade

Step 2. Installing PHP 7 on Debian 9.

First, install the dependencies necessary to add a new repository over HTTPS:

sudo apt install apt-transport-https ca-certificates curl software-properties-common

Next add the GPG key and enable the ondrej’s repository:

curl -fsSL https://packages.sury.org/php/apt.gpg | sudo apt-key add -
sudo add-apt-repository "deb https://packages.sury.org/php/ $(lsb_release -cs) main"

Now install PHP by specifying the version we want to use:

sudo apt update
sudo apt install php7.2-common php7.2-cli

Once the package has finished installing, we can test PHP in the command line:

php -v

If PHP installed correctly, you should see something similar below:

PHP 7.2.8-1+0~20180902124257.2+stretch~1.gbp571e46 (cli) (built: Sep 02 2018 12:11:00) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.8-1+0~20180902124257.2+stretch~1.gbp571e46, Copyright (c) 1999-2018, by Zend Technologies

You may also need to install modules based on your application requirements. Use the following command to search available PHP 7 modules in the package repository:

sudo apt-cache search php7*

Step 3. Verify PHP for Apache.

Create a new file called info.php in /var/www/html.

sudo nano /var/www/html/info.php

Paste in the following PHP code:

<?php
phpinfo();

Then, load this file in the browser by going to:

http://example.com/info.php or http://your_ip/info.php

Congratulation’s! You have successfully install and configured PHP 7 on your Debian Stretch. Thanks for using this tutorial installing PHP 7 on Debian 9 (Stretch) system.

How to Install Nginx on Debian 9

Install Nginx on Debian 9

In this tutorial we are going to learn how to install Nginx on Debian 9. We will also install and configure its prerequisites. Nginx is one of the most common open source web server software. It is widely used for load balancing, reverse proxying, media streaming and much more. The specialization of Nginx is its capability to operate on little resource and handle a high number of requests. Nginx works as an internet server, proxy, load balancer and Reverse Proxy. Today Nginx is installed on more afterward 450 million servers net, and is used by a few of the maximum traffic sites on the internet such as Dropbox and Netflix.

I recommend to use a minimal Ubuntu server setup as a basis for the tutorial, that can be a virtual or a root server image with an Debian 9 Stretch minimal install from a web hosting company or you use our minimal server tutorial to install a server from scratch.

Install Nginx on Debian 9

Step 1. First, before we install packages, it’s a good idea to update repository and software packages. Run the following command on your Debian 9 OS:

sudo apt update
sudo apt upgrade

Step 2. Installing Nginx on Debian 9 Stretch.

Nginx is available in the Debian package repositories simple. Follow this command to install Nginx:

sudo apt install nginx

Once the installation is completed, check the status and the version of the Nginx service, with:

systemctl start nginx
systemctl enable nginx

Step 3. Configure Firewall ports for Nginx.

If you use iptables to filter connections to your system, you’ll need to open HTTP (80) and HTTPS (443) ports:

sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 443 -j ACCEPT

Step 4. Verifying Apache Installation.

To verify that everything works correctly, open your browser, type your server IP address or doman name http://Your_IP_or_Your_Domain/

Step 5. Nginx Configuration File Structure.

  • Nginx configuration files are stored in the /etc/nginx directory.
  • The main Nginx configuration file is /etc/nginx/nginx.conf.
  • Server block (vhost) configuration files are stored in /etc/nginx/sites-available directory. The configuration files found in this directory are not used by Nginx unless they are linked to the /etc/nginx/sites-enabled directory.
  • Activating server blocks is done by creating a symlink (a pointer) from the configuration file sites in a sites-available directory to the sites-enabled directory.
  • To write more maintainable code, it’s a good idea to a follow a standard naming convention. For example if your domain name is mydomain.com then your the configuration file should be named /etc/nginx/sites-available/mydomain.com.conf.
  • The /etc/nginx/snippets directory contains configuration snippets that can be included in the server block files. If you use repeatable configuration segments then you can refactor those segments into snippets and include the snippet file to the server blocks.
  • Nginx log files (access.log and error.log) are located in the /var/log/nginx/ directory. It is recommended to have a different access and error log files for each server block.

Congratulation’s! You have successfully install and configured Nginx on your Debian Stretch. Thanks for using this tutorial installing Nginx web server on Debian 9 (Stretch) system.

How to Install Joomla on Ubuntu 18.04

Install Joomla on Ubuntu 18.04

In this tutorial we are going to learn how to install Joomla on Ubuntu 18.04. We will also install and configure its prerequisites. Joomla is a powerful content management system for building websites and programs. Written in PHP, Joomla forces a variety of websites, including portals, intranets, online books, e-commerce shops, and government apps. Joomla also has a rich ecosystem of plugins, themes, and specialist consultants to ease the process of building everything you might want on its wealthy platform.

I recommend to use a minimal Ubuntu server setup as a basis for the tutorial, that can be a virtual or a root server image with an Ubuntu 18.04 Bionic Beaver minimal install from a web hosting company or you use our minimal server tutorial to install a server from scratch.

Install Joomla on Ubuntu 18.04

Step 1. First, ensure your system and apt package lists are fully up-to-date by running the following:

apt-get update -y
apt-get upgrade -y

Step 2. Installing LAMP on Ubuntu 18.04 LTS.

You should check out this LAMP stack install tutorial for Ubuntu 18.04, if you haven’t installed LAMP yet. Once it’s installed, come back here and read on.

Step 3. Installing Joomla on Ubuntu 18.04 Bionic Beaver.

To download the Joomla package, go to its official website, copy the link of Joomla 3.8.12 stable zip package from it and paste it using ‘wget’ command on your terminal:

wget https://github.com/joomla/joomla-cms/releases/download/3.8.12/Joomla_3.8.12-Stable-Full_Package.zip
unzip -q Joomla*.zip -d /var/www/html

Once it is done, set the owner permission for Apache root directory:

chown -R www-data.www-data /var/www/html
chmod -R 755 /var/www/html

Step 4. Configure Database for Joomla.

Next, we need to create a database for the Joomla installation:

mysql -uroot -p

Run the following command to create a database for Joomla:

create database joomla;
create user joomlauser@localhost IDENTIFIED BY 'joomlapassword';
GRANT all ON joomla.* TO joomlauser@localhost;
flush privileges;
exit

Step 5. Accessing Joomla Web Installation.

Now you can access the Joomla web install wizard in your browser by entering the domain name or http://your_ip/ to continue your Joomla installation.

Install Joomla on Ubuntu 18.04

Congratulation’s! You have successfully install and configured Joomla on your Ubuntu 18.04 server. Thanks for using this tutorial for installing Joomla content management system on Ubuntu 18.04 LTS (Bionic Beaver) system.

Save

Save

Save

How to Install PostgreSQL on Debian 9

Install PostgreSQL on Debian 9

In this tutorial we are going to learn how to install PostgreSQL on Debian 9. We will also install and configure its prerequisites. PostgreSQL is a free, open-source object-relational database management system (object-RDBMS), similar to MySQL, and is standards-compliant and extensible. It is commonly used as a back-end for web and mobile applications.

I recommend to use a minimal Ubuntu server setup as a basis for the tutorial, that can be a virtual or a root server image with an Debian 9 Stretch minimal install from a web hosting company or you use our minimal server tutorial to install a server from scratch.

Install PostgreSQL on Debian 9

Step 1. First, ensure your system and apt package lists are fully up-to-date by running the following:

apt-get update -y
apt-get upgrade -y

Step 2. Installing PostgreSQL on Debian 9.

Run the following command to install the PostgreSQL 9 package:

sudo apt install postgresql postgresql-contrib

When the installation is completed, the PostgreSQL service will start automatically. To check an verify that PosgreSQL server/client are installed, you can use the following command:

psql --version

Step 3. Basic PostgreSQL usage on Debian 9.

Let’s log in to postfix to verify that installation completed successfully:

su - postgres

Use psql command to access PostgreSQL prompt with admin privileges:

$ psql

psql (9.6.7)
Type "help" for help.

postgres=#

You may create password for user postgres for security purpose:

postgres=# \password postgres

Now you can execute command specific to PostgreSQL. For example, to list all current databases you can type \l and press Enter:

postgres=# \l
                                  List of databases
   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
 postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
 template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
(3 rows)

You can also create databases and tables, insert data, retrieve data and do many other things using the PostgreSQL interactive terminal.

Congratulation’s! You have successfully install and configured PostgreSQL on your Debian Stretch. Thanks for using this tutorial installing PostgreSQL on Debian 9 (Stretch) system.

How to Install ELK Stack on Ubuntu 18.04

Install ELK Stack on Ubuntu 18.04

In this tutorial we are going to learn how to install ELK Stack on Ubuntu 18.04. We will also install and configure its prerequisites. Elasticsearch, Logstash and Kibana are the three open-source products that are part of the group named ELK stack. It’s a robust solution for research, analyze and visualization of information. As we already know Elasticsearch is distributed, RESTful search and analytics NoSQL engine based on Lucene, the light-weight information processing pipeline or Logstash is employed for handling events and logs from many different sources and Kibana that’s a web application is used for information visualization that works together with Elsticsearch.

I recommend to use a minimal Ubuntu server setup as a basis for the tutorial, that can be a virtual or a root server image with an Ubuntu 18.04 Bionic Beaver minimal install from a web hosting company or you use our minimal server tutorial to install a server from scratch.

Install ELK Stack on Ubuntu 18.04

Step 1. First, ensure your system and apt package lists are fully up-to-date by running the following:

apt-get update -y
apt-get upgrade -y

Step 2. Installing Java.

Elasticsearch requires either OpenJDK or Oracle JDK available on your Ubuntu:

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

Check that java is successfully installed using the following command:

java -version

Step 3. Installing Elasticsearch and Kibana on Ubuntu 18.04 Bionic Beaver.

First, add The Elastic repository:

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -

Next, Create a file at /etc/apt/sources.list.d/elastic.list, and paste the following line into it:

deb https://artifacts.elastic.co/packages/6.x/apt stable main

Install Elasticsearch and Kibana using following command:

sudo apt install elasticsearch kibana

Then, editing the Kibana configuration file:

nano /etc/kibana/kibana.yml

Uncomment the configuration lines for server.port, server.host and elasticsearch.url:

server.host: "localhost"

Restart Kibana and start up Elasticsearch, and both will be ready to go:

sudo systemctl restart kibana
sudo systemctl start elasticsearch

Step 4. Installing Nginx.

Install Nginx and of course to configure it as a reverse proxy to access Kibana from the public IP address:

apt install nginx

Next, create authentication file using the htpasswd command:

echo "idroot:`openssl passwd -apr1 YourPassword`" | sudo tee -a /etc/nginx/htpasswd.kibana

Then, create a new virtual host configuration:

nano /etc/nginx/sites-available

Paste the configuration below:

server {
        listen 80;

        server_name your-site.com;

        auth_basic "Restricted Access";
        auth_basic_user_file /etc/nginx/htpasswd.kibana;

        location / {
            proxy_pass http://localhost:5601;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection 'upgrade';
            proxy_set_header Host $host;
            proxy_cache_bypass $http_upgrade;        
        }
    }

Remove the existing default config, and create a new symlink in sites-enabled for Kibana:

sudo rm /etc/nginx/sites-enabled/default
sudo ln -s /etc/nginx/sites-available/kibana /etc/nginx/sites-enabled/kibana

Start the Nginx service and set it to start automatically on boot:

sudo systemctl enable nginx
sudo systemctl start nginx

Step 6. Installing Logstash.

Install Logsatash and configure it to centralize server logs from clients with filebeat, then filter and transform the Syslog data and move it into the stash:

sudo apt install logstash

Start the Logstash service and set it to start automatically on boot:

systemctl restart logstash
systemctl enable logstash

Step 7. Accessing Kibana.

Open up your browser, and go to the address that you assigned to your Kibana instance in the Nginx configuration. You should be prompted to enter the username and password that you set up for Kibana.

Congratulation’s! You have successfully install and configured Elasticsearch, Logstash, and Kibana on your Ubuntu 18.04 LTS server. Thanks for using this tutorial for installing ELK Stack on Ubuntu 18.04 LTS (Bionic Beaver) system.

How to Install Apache Tomcat on Debian 9

Install Apache Tomcat on Debian 9

In this tutorial we are going to learn how to install Apache Tomcat on Debian 9. We will also install and configure its prerequisites. Apache Tomcat is a web server and servlet container that is used to serve Java applications. Tomcat is an open source implementation of the Java Servlet and JavaServer Pages technologies, published by the Apache Software Foundation.

I recommend to use a minimal Ubuntu server setup as a basis for the tutorial, that can be a virtual or a root server image with an Debian 9 Stretch minimal install from a web hosting company or you use our minimal server tutorial to install a server from scratch.

Install Apache Tomcat on Debian 9

Step 1. First, before we install packages, it’s a good idea to update repository and software packages. Run the following command on your Debian 9 OS:

sudo apt update
sudo apt upgrade

Step 2. Installing Java.

Apache Tomcat is written in Java application, so Java runtime environment needs to be installed:

sudo apt install default-jdk

Once Java is installed, you can verify the Java version by using the following command:

java -version

Step 3. Create Tomcat Group and User.

Tomcat should not be run as root user. So, create a normal user for running the Tomcat service:

sudo useradd -m -U -d /opt/tomcat -s /bin/false tomcat

Step 4. Installing the latest Apache Tomcat on Debian 9.

First, download the latest version of the Apache Tomcat from the website:

cd /tmp
wget http://www-us.apache.org/dist/tomcat/tomcat-8/v8.5.31/bin/apache-tomcat-8.5.31.zip

Then extract the Tomcat archive and move it to your desired (/opt/tomcat) directory:

unzip apache-tomcat-*.zip
sudo mv apache-tomcat-*/ /opt/tomcat

Next, we will create a symbolic link named latest which will point to the Tomcat installation directory:

sudo ln -s /opt/tomcat/apache-tomcat-* /opt/tomcat/latest

Now change the proper ownership using following command:

sudo chown -R tomcat: /opt/tomcat
sudo chmod +x /opt/tomcat/latest/bin/*.sh

Step 5. Create Systemd Unit for Tomcat.

Now you will need to create a systemd service file to manage the Tomcat process so you can run Tomcat as a service:

nano /etc/systemd/system/tomcat.service

Add the below information to Tomcat systemd service file:

[Unit]
Description=Tomcat 8.5 servlet container
After=network.target

[Service]
Type=forking

User=tomcat
Group=tomcat

Environment="JAVA_HOME=/usr/lib/jvm/default-java"
Environment="JAVA_OPTS=-Djava.security.egd=file:///dev/urandom"

Environment="CATALINA_BASE=/opt/tomcat/latest"
Environment="CATALINA_HOME=/opt/tomcat/latest"
Environment="CATALINA_PID=/opt/tomcat/latest/temp/tomcat.pid"
Environment="CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC"

ExecStart=/opt/tomcat/latest/bin/startup.sh
ExecStop=/opt/tomcat/latest/bin/shutdown.sh

[Install]
WantedBy=multi-user.target

Notify systemd that we created a new unit file and start the Tomcat service by executing:

systemctl daemon-reload
systemctl start tomcat 
systemctl enable tomcat

Step 6. Configure Firewall Apache Tomcat.

In order to test Apache Tomcat in a web browser, you need to modify the firewall rules:

sudo ufw allow 8080

Step 7. Configure Tomcat Web Management Interface.

In order to use the manager webapp that comes with Tomcat, we must add a login to our Tomcat server. We will do this by editing the tomcat-users.xml file:

nano /opt/tomcat/conf/tomcat-users.xml

Place the following two lines just above the last line:

<role rolename="admin-gui,manager-gui"/>
<user username="admin" password="tomcat" roles="manager-gui,admin-gui"/>

Restart Apache Tomcat to put your modifications into effect:

systemctl restart tomcat

Step 8. Accesing Apache Tomcat.

The Apache Tomcat is now accessible on the default port, which is 8080. The admin UI should be accessible at:

http://<your_domain_or_IP_address>:8080

Congratulation’s! You have successfully install and configured Tomcat on your Debian Stretch. Thanks for using this tutorial installing Apache Tomcat on Debian 9 (Stretch) system.

How to Install Go on CentOS 7

Install Go on CentOS 7

In this tutorial we are going to learn how to install Go on CentOS 7. We will also install and configure its prerequisites. Go also understand as Golang, is an open source programming language developed by Google. Many popular programs, including Grafana, Docker and Kubernetes, are written in Go.

I recommend to use a minimal CentOS server setup as a basis for the tutorial, that can be a virtual or a root server image with an CentOS 7 minimal install from a web hosting company or you use our minimal server tutorial to install a server from scratch.

Install Go on CentOS 7

Step 1. First, ensure your system and apt package lists are fully up-to-date by running the following:

yum -y install epel-release
yum -y update

Step 2. Installing Go on CentOS 7.

First, download the Go binary you can use either wget or curl:

wget https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz

Now extract the downloaded archive and install it to the desired location on your system:

sudo tar -C /usr/local -xzf go1.10.3.linux-amd64.tar.gz

Then add it to your path:

export PATH=$PATH:/usr/local/go/bin

Save the file, and load the new PATH environment variable into the current shell session:

source ~/.bash_profile

At this step, you have successfully installed and configured go language on your system. First, use the following command to check Go version:

go version

Step 3. Test the Installation.

To test whether Go is installed, we will set up a workspace and build a simple “Hello world” program:

mkdir ~/go
mkdir -p ~/go/src/hello

And in that directory create a file named hello.go:

### ~/go/src/hello/hello.go
package main

import "fmt"

func main() {
    fmt.Printf("Hello, World\n")
}

Next, build the file switch to the ~/go/src/hello directory and run go build:

cd ~/go/src/hello
go build

Then, run the executable by simply executing the command bellow:

./hello

Result:

Hello, World

Congratulation’s! You have successfully install Go on your CentOS 7 server. Thanks for using this tutorial for installing Go language on CentOS 7 system.