Follow Unixmen on Feedspot

Continue with Google
Continue with Facebook


PostgreSQL Database System

PostgreSQL is an advanced open source Object-Relational Database Management System (or ORDBMS). It is an extensible and highly-scalable database system, meaning that it can handle loads ranging from single machine applications to enterprise web services with many concurrent users. PostgreSQL is transactional and ACID-compliant (Atomicity, Consistency, Isolation, Durability).

It supports a large part of the SQL standard, and offers many features including:

  • Complex queries
  • Foreign keys
  • Triggers
  • Updatable views
  • Transactional integrity
  • Multiversion concurrency control

As previously said, the PostgreSQL database system can be extended by its users. There are different ways to do this, like adding new functions, operators, data types, index methods, procedural languages, etc.

It is developed by the PostgreSQL Global Development Group and released under the terms of the PostgreSQL License.

PostgreSQL provides many ways to replicate a database. in this tutorial we will configure the Master/Slave replication, which is the process of syncing data between two database by copying from a database on a server (the master) to one on another server (the slave).

This configuration will be done on a server running Ubuntu 16.04.


PostgreSQL 9.6 installed on the Ubuntu 16.04 Servers

Configure UFW

UFW (or Uncomplicated Firewall) is a tool to manage iptables based firewall on Ubuntu systems. Install it (on both servers) through apt by executing:

# apt-get install -y ufw

Next, add PostgreSQL and SSH service to the firewall. To do this, execute:

# ufw allow ssh
# ufw allow postgresql

Enable the firewall:

# ufw enable
Configure PostgreSQL Master Server

The master server will have reading and writing permissions to the database, and will be the one capable of performing data streaming to the slave server.

With a text editor, edit the PostgreSQL main configuration file, which is /etc/postgresql/9.6/main/postgresql.conf:

# $EDITOR /etc/postgresql/9.6/main/postgresql.conf

Uncomment the listen_addresses line and edit adding the master server IP address:

listen_addresses = 'master_server_IP_address'

Next, uncomment the wal_level line changing its value:

wal_level = hot_standby

To use local syncing for the synchronization level, uncomment and edit the following line:

synchronous_commit = local

We are using two servers, so uncomment and edit the two lines as follows:

max_wal_senders = 2
wal_keep_segments = 10

Save and close the file.

Edit the pg_hba.conf file for the authentication configuration.

# $EDITOR /etc/postgresql/9.6/main/pg_hba.conf
Paste the following configuration:

# Localhost
host    replication     replica            md5
# PostgreSQL Master IP address
host    replication     replica          master_IP_address/32            md5
# PostgreSQL SLave IP address
host    replication     replica          slave_IP_address/32            md5

Save, exit and restart PostgreSQL:

# systemctl restart postgresql
Create a User for Replication

Create a new PostgreSQL user for the replication process. Log in to the postgres user and start PostgreSQL shell:

# su - postgres
$ psql

Create a new user:


Close the shell.

This concludes the master server configuration.

Configuring the Slave Server

The slave server won’t have writing permissions to the database, being that its only function is to accept streaming from the master. So it will have only READ permissions.

First, stop the PostgreSQL service:

# systemctl stop postgresql

Edit the PostgreSQL main configuration file:

# $EDITOR /etc/postgresql/9.6/main/postgresql.conf

In this file, uncomment the listen_addresses line and change its value:.

listen_addresses = 'slave_IP_address'

Next, uncomment the wal_level line and change as follow:

wal_level = hot_standby

As in the master settings, uncomment the synchronous_commit line to use local syncing.

synchronous_commit = local

Also as in the master, uncomment and edit the following two lines:

max_wal_senders = 2
wal_keep_segments = 10

Enable hot_standby for the slave server by uncommenting the following line and changing its value:

hot_standby = on

Save and exit.

Copy Data From Master to Slave

To sync from master to slave server, the PostgreSQL main directory on the slave must be replaced with the main directory from the master. In the slave server, log in to the postgres user:

# su - postgres

Make a backup of the actual data directory:

$ cd/var/lib/postgresql/9.6/
$ mv main main_bak

Create a new main directory:

$ mkdir main/

Change permissions:

$ chmod 700 main

At this point, copy the main directory from the master to the slave server by using pg_basebackup:

# pg_basebackup -h master_IP_address -U replica -D /var/lib/postgresql/9.6/main -P --xlog

Once the transfer is complete, in the main directory create a new recovery.conf file, and paste the following content:

standby_mode = 'on'
primary_conninfo = 'host= port=5432 user=replica password=usr_strong_pwd'
trigger_file = '/tmp/postgresql.trigger.5432'

Save, exit and change permissions to this file:

# chmod 600 recovery.conf

Start PostgreSQL:

# systemctl start postgresql

This concludes the slave server configuration.


We have seen how to configure the PostgreSQL master/slave replication, by using two servers running Ubuntu 16.04. This is just one of the many replication capabilities provided by this advanced and fully open source database system.

The post PostgreSQL Replication on Ubuntu Tutorial appeared first on Unixmen.

Read Full Article
Visit website
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

What’s Rocket.Chat

Rocket.Chat is a professional, Slack-like messaging system, developed for companies wanting to privately host their own chat service. It is developed in JavaScript using the Meteor full stack framework.

It has many features, like:

    • Help desk chat
    • Video conferences
    • File sharing
    • Link previews
    • Voice messages

We will install Rocket.Chat on a Debian 9 server.

Getting Started

The first thing to do is to satisfy Rocket.Chat dependencies. Execute the following apt command:

# apt install build-essential graphicsmagick
Install MongoDB

Rocket.Chat works with MongoDB as database system. There aren’t already Debian 9 packages for MongoDB, so we will install it from the tarball.

Download the tarball

First, download with curl the MongoDB tarball

$ curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian81-3.4.9.tgz
Extract the archive

Extract the previously downloaded archive by executing the following command:

$ tar -zxvf mongodb-linux*.tgz

Rename and move the directory, for example, in /opt:

# mv mongodb-linux-x86_64-debian81-3.4.9/ /opt/mongodb

Update the PATH variable by adding the /opt/mongodb/bin directory. In ~/.bashrc add the following line:

$ export PATH=${PATH}:/opt/mongodb/bin
Create a unit file

Create a systemctl unit file for MongoDB, executing the following command:

# $EDITOR /lib/systemd/system/mongodb.service

In this file, paste the following content:

Description=A document-oriented database

ExecStart=/opt/mongodb/bin/mongod --unixSocketPrefix=${SOCKETPATH} --config ${CONF} $DAEMON_OPTS


Save and exit.

Reload systemd daemon service:

# systemctl daemon-reload
Start MongoDB

At this point, we can start MongoDB and enable it for starting at boot time:

# systemctl start mongodb
# systemctl enable mongodb
Install Node.js and npm

Rocket.Chat requires Node.js (in particular, any version newer than 4.5) and npm. First of all, add the NodeSource repository:

# curl -sL https://deb.nodesource.com/setup_8.x | bash -

Next, execute the following command for installing both Node.js and npm:

# apt-get install nodejs

Check the Node.js version:

# node --version

Next, install n through npm:

# npm install -g n

With n, it’s possible to change Node.js version.

Install Rocket.Chat

If not exists, create the /var/www directory, which will store Rocket.Chat:

# mkdir -p /var/www
# cd /var/www

In that directory, execute the following command for downloading Rocket.Chat:

# wget https://s3.amazonaws.com/download.rocket.chat/build/rocket.chat-0.58.4.tgz -O rocket.chat.tgz

Extract the archive and rename the extracted folder:

# tar xzf rocket.chat.tgz
# mv bundle Rocket.Chat

Next, set environment variables and run the Rocket.Chat server:

# cd Rocket.Chat/programs/server
# npm install
# cd ../..

# export ROOT_URL=http://example.com:3000/
# export MONGO_URL=mongodb://localhost:27017/rocketchat
# export PORT=3000

Those who are using the replica set should set the MONGO_URL variable with this content: mongodb://localhost:27017/rocketchat?replicaSet=001-rs

Rocket.Chat is installed and configured, but it requires configuration behind a web server. In this tutorial we’ll be using NGINX.

Install NGINX

NGINX can be install with apt:

# apt install nginx

Create a new directory that will contain the SSL certificates:

# mkdir -p /etc/nginx/ssl/

In this directory, generate a new key:

# openssl req -new -x509 -days 365 -nodes -out /etc/nginx/ssl/rocketchat.crt -keyout /etc/nginx/ssl/rocketchat.key

Change permissions to the key file:

# chmod 400 rocketchat.key

Create a Virtual Host file:

# $EDITOR /etc/nginx/sites-available/rocketchat

In this file, paste the following content:

# Upstreams
upstream backend {
# Redirect Options
server {
  listen 80;
  server_name chat.mydomain.com;
  # enforce https
  return 301 https://$server_name$request_uri;
# HTTPS Server
server {
    listen 443;
    server_name chat.mydomain.com;
    error_log /var/log/nginx/rocketchat.access.log;
    ssl on;
    ssl_certificate /etc/nginx/ssl/rocketchat.crt;
    ssl_certificate_key /etc/nginx/ssl/rocketchat.key;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # dont use SSLv3 ref: POODLE
    location / {
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forward-Proto http;
        proxy_set_header X-Nginx-Proxy true;
        proxy_redirect off;

Save and close the file. Activate the configuration with:

# ln -s /etc/nginx/sites-available/rocketchat /etc/nginx/sites-enabled/rocketchat


# nginx -t

If no errors occur, restart the web server:

# systemctl restart nginx

Next, update the environment variables:

# cd /var/www/Rocket.Chat/ 
# export ROOT_URL=https://chat.example.com 
# export MONGO_URL=mongodb://localhost:27017/rocketchat?replicaSet=001-rs 
# export PORT=3000

Run Rocket.Chat:

# node main.js

The final step is to insert the following URL into a web browser: https://chat.example.com to register a new admin account and finish the graphical configuration.


There you have it! We’ve just explained how to install and configure your Rocket.Chat Server on a Debian 9 server using NGINX. This useful online communication program can help your team work more efficiently and with more collaboration!

The post Rocket.Chat: How To Install The Messaging System on Debian 9 appeared first on Unixmen.

Read Full Article
Visit website
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Introduction – NoSQL and OrientDB

When talking about databases, in general, we refer to two major families: RDBMS (Relational Database Management System), which use as user and application program interface a language named Structured Query Language (or SQL) and non-relational database management systems, or NoSQL databases. OrientDB is part of the second family.

Between the two models there is a huge difference in the way they consider (and store) data.

Relational Database Management Systems

In the relational model (like MySQL, or its fork, MariaDB), a database is a set of tables, each containing one or more data categories organized in columns. Each row of the DB contains a unique instance of data for categories defined by columns.

Just as an example, consider a table containing customers. Each row correspond to a customer, with columns for name, address, and every required information.
Another table could contain an order, with product, customer, date and everything else. A user of this DB can obtain a view that fits its needs, for example a report about customers that bought products in a specific range of prices.

NoSQL Database Management Systems

In the NoSQL (or Not only SQL) database management systems, databases are designed implementing different “formats” for data, like a document, key-value, graph and others. The database systems realized with this paradigm are built especially for large-scale database clusters, and huge web applications. Today, NoSQL databases are used by major companies like Google and Amazon.

Document databases

Document databases store data in document format. The usage of this kind of DBs is usually raised with JavaScript and JSON, however, XML and other formats are accepted. An example is MongoDB.

Key-value databases

This is a simple model pairing a unique key with a value. These systems are performant and highly scalable for caching. Examples include BerkeleyDB and MemcacheDB.

Graph databases

As the name predicts, these databases store data using graph models, meaning that data is organized as nodes and interconnections between them. This is a flexible model which can evolve over time and use. These systems are applied where there is the necessity of mapping relationships.
Examples are IBM Graphs and Neo4j and OrientDB.


OrientDB, as stated by the company behind it, is a multi-model NoSQL Database Management System that “combines the power of graphs with documents, key/value, reactive, object-oriented and geospatial models into one scalable, high-performance operational database“.

OrientDB has also support for SQL, with extensions to manipulate trees and graphs.

  • One server running CentOS 7
  • OpenJDK or Oracle Java installed on the server

This tutorial explains how to install and configure OrientDB Community on a server powered by CentOS 7.

OrientDB Installation Step 1 – Create a New User

First of all, create a new user to run OrientDB. Doing this will let to run the database on an “isolated environment”. To create a new user, execute the following command:

# adduser orientdb -d /opt/orientdb
Step 2 – Download OrientDB Binary Archive

At this point, download the OrientDB archive in the /opt/orientdb directory:

# wget https://orientdb.com/download.php?file=orientdb-community-importers-2.2.29.tar.gz -O /opt/orientdb/orientdb.tar.gz

Note: at the time we write, 2.2.29 is the latest stable version.

Step 3 – Install OrientDB

Extract the downloaded archive:

# cd /opt/orientdb
# tar -xf orientdb.tar.gz

tar will extract the files in a directory named orientdb-community-importers-2.2.29. Move everything in /opt/orientdb:

# mv orientdb-community*/* .

Make the orientdb user the owner of the extracted files:

# chown -R orientdb:orientdb /opt/orientdb
Start OrientDB Server

Starting the OrientDB server requires the execution of the shell script contained in orientdb/bin/:

# /opt/orientdb/bin/server.sh

During the first start, this installer will display some information and will ask for an OrientDB root password:

| This is the first time the server is running. Please type a |
| password of your choice for the 'root' user or leave it blank |
| to auto-generate it. |
| |
| To avoid this message set the environment variable or JVM |
| setting ORIENTDB_ROOT_PASSWORD to the root password to use. |

Root password [BLANK=auto generate it]: ********
Please confirm the root password: ********

To stop OrientDB, hit Ctrl+C.

Create a systemd Service for OrientDB

Create a new ststemd service to easily manage OrientDB start and stop. With a text editor, create a new file:

# $EDITOR /etc/systemd/system/orientdb.service

In this file, paste the following content:

Description=OrientDB service



Save the file and exit.

Reload systemd daemon service:

# systemctl daemon-reload

At this point, start OrientDB with the following command:

# systemctl start orientdb

Enable it to start at boot time:

# systemctl enable orientdb

In this tutorial we have seen a brief comparison between RDBMS and NoSQL DBMS. We have also installed and completed a basic configuration of OrientDB Community server-side.

This is the first step for deploying a full OrientDB infrastructure, ready for managing large-scale systems data.

The post OrientDB: How To Install the NoSQL DataBase on CentOS 7 appeared first on Unixmen.

Read Full Article
Visit website
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

What Is WebERP Accounting and Business Management System

WebWEP is a totally web based accounting and business management system. It is particularly suitable for distributed businesses in wholesale, distribution and manufacturing. WebERP can be customized with third party complementary components and can also function as a web-shop or Retail Management System.

According to the project’s web site “the growth of webERP adoption has been entirely through word of mouth testimony – there has never been a marketing or advertising push to “sell” webERP. Of course there are no funds nor commercial incentive to do so for free software. This growth is built on reputation and solid practical functionality that works as tried and tested by an increasing number of businesses.”

WebERP Main Features

WebERP has many features:

  • Runs on any web-server that can accommodate PHP – can use an ISP instead of having/maintaining own server
  • Minimal use of javascript for maximum compatibility with all web-browsers and web enabled devices. Some small amounts used to improve error-trapping and user interactivity.
  • Produces reports to Portable Document Format – PDF for accurate positioning of text
  • All reports and scripts easily modifiable PHP text
  • All processing on the server and no installation required on client machines
  • Fully utf-8 compliant. PDF reports produced using adobe CIF fonts for lightweight PDFs using utf-8 character set for any language
  • Multi-theme – each user can see the interface in their preferred graphical theme
  • The underlying code of the system is written in a way so as to maximise it’s readability for those new to PHP coding. The idea being that business users will be able to administer and adapt the system to exactly suit their needs.
  • Users can be defined with access to only certain options using a role based model
  • Options applicable to certain roles can be graphically configured and users defined as fulfilling a given role.
  • Incorrect entry of password (more than 3 times) blocks the account until reset by the System Administrator. This prevents password crackers from breaking the security.
  • Pages can be encrypted using SSL and webERP can be configured to only display pages using SSL to ensure that all information passing over the internet is encrypted.
  • Very flexible taxation options suitable for Canada, US, South Africa, UK, Australia, NZ and most other countries
  • Tax rates dependent on the type of product – using tax categories
  • Tax rates dependent on the location of the warehouse dispatched from
  • Tax rates dependent on the location of the customer
  • Multiple taxes payable to different tax authorities
  • Each tax posted to different user-definable general ledger accounts – if linked to AR/AP

In this guide we will show how to install WebERP on an Ubuntu 16.04 server with an installed LAMP stack.


Install a LAMP stack (you can follow our guide), and then go on with the MariaDB configuration.

MariaDB Configuration

We need to create a new database and user for WebERP. First of all, login to MariaDB shell:

$ mysql -u root -p

Create a new user for WebERP. In this guide we will create the weberp_usr user. Execute the following MariaDB query:

MariaDB [(none)]>CREATE USER 'weberp_usr'@'localhost' IDENTIFIED BY 'usr_strong_password';

Next, create a new database. We will name it weberpdb:

MariaDB [(none)]>CREATE DATABASE weberpdb;

Grant all the privileges to weberp_usr user on the new database:

MariaDB [(none)]>GRANT ALL PRIVILEGES ON weberpdb.* TO 'weberp_usr'@'localhost';

Flush the privileges and close the shell:

MariaDB [(none)]>EXIT;

At this point, we are ready to install WebERP.

WebERP Installation Download WebERP

The latest version of WebERP can be downloaded from their official site. We will do it with the following wget command:

$ wget https://excellmedia.dl.sourceforge.net/project/web-erp/webERP4.14.1.zip

Unzip and move the extracted directory to the Apache Web Root directory:

$ unzip webERP4.14.1.zip
# cp -r webERP /var/www/html/weberp

Change the ownership of the weberp directory:

# chown -R www-data:www-data /var/www/html/weberp
Create a new Apache Virtual Host for WebERP

Now, create a new Virtual Host file:

# $EDITOR /etc/apache2/sites-available/weberp.conf

Paste the following content:

<VirtualHost *:80>
   ServerAdmin admin@example.com
   DocumentRoot "/var/www/html/weberp/"
   ServerName example.com
   ServerAlias www.example.com
   <Directory "/var/www/html/weberp/">
      Options FollowSymLinks
      AllowOverride All
      Order allow,deny
      allow from all
   ErrorLog /var/log/apache2/weberp-error_log
   CustomLog /var/log/apache2/weberp-access_log common

Save and close the file, and then activate the new virtual host, by executing the following command:

# a2ensite weberp

Restart Apache:

# systemctl restart apache2
Firewall Configuration

On simple HTTP connections, WebERP runs on port 80. Allow this port through the UFW firewall by executing the command:

# ufw allow 80/tcp

And that’s all.

Final Installation Step

The last step is to open a web browser and go to the URL example.com. The browser will redirect to the WebERP Welcome Page. Starting from that page, you can finish the configuration in your browser.


In this guide we have seen how to install WebERP accounting and business management system on a server powered by Ubuntu 16.04 and Apache as web server.

The post Business Management System: Install WebERP on Ubuntu 16.04 appeared first on Unixmen.

Read Full Article
Visit website
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 


Askbot is an open source Question and Answer (Q&A) forum project. It is inspired by StackOverflow and Yahoo Answers.
Askbot is written in Python on top of the Django framework.

  • Efficient question and answer knowledge management
  • Focused on-topic discussions
  • Best answers are shown first
  • Tag and categorize
  • Follow-up in the comments
  • Organize comments and answers by re-posting
  • Everything is editable
  • Users are rewarded with karma for posting useful information
  • Upvotes grow users karma and the downvotes decrease it
  • Votes identify best content, while karma spotlights and rewards experts
  • User privileges grow along with their reputation.
  • Choose either public, private or hidden karma.
  • When new posts are made users can receive notifications

Askbot is being used by Fedora and Shazam Community, among the others.

In this tutorial we will see how to install and configure Askbot on a CentOS 7 Server.

Dependencies Installation

First of all, install packages required by Askbot. On CentOS, these are the “Development Tool” group, EPEL and Python packages.

Install the “Development Tool” group by executing the following yum command:

# yum group install 'Development Tools'

Next, install EPEL repository:

# yum install epel-release

Last dependencies are those related to Python. In particular, we will use pip to install Askbot:

# yum install python-pip python-devel python-six
Install PostgreSQL

Askbot uses PostgreSQL as database system to store its data. PostgreSQL is available in CentOS 7 repositories, so install it executing the following command:

# yum -y install postgresql-server postgresql-devel postgresql-contrib

Once the installation is complete, initialize the database with the following command:

$ postgresql-setup initdb

Next, start PostgreSQL and enable it to start at boot time:

#systemctl start postgresql
#systemctl start postgresql

Login as postgres user and access the psql command line tool:

$ su - postgres
$ psql
Create a Database For Askbot

Create a new database and user for Askbot, with the following PostgreSQL queries:

postgres=# create database askbotdb;
postgres=# create user askbotusr with password 'usr_strong_pwd';
postgres=# grant all privileges on database askbotdb to askbotusr;
Configure PostgreSQL

Edit PostgreSQL configuration file for authentication setup, which is /var/lib/pgsql/data/pg_hba.conf:

# $EDITOR /var/lib/pgsql/data/pg_hba.conf

Change all authentication to mIn this tutorial we will see how to install and configure Askbot on a CentOS 7 Server.d5:

local all all md5
 # IPv4 local connections:
 host all all md5
 # IPv6 local connections:
 host all all ::1/128 md5

Save, close the file and restart PostgreSQL:

# systemctl restart postgresql
Install and Configure Askbot

At this point, it is possible to install Askbot. First of all, create a new user, named askbot:

# useradd -m -s /bin/bash askbot
# passwd askbot

Next, add this new user to the wheel group:

# usermod -a -G wheel askbot

Upgrade pip to the latest version:

# pip install --upgrade pip

Next, install the virtualenv package:

# pip install virtualenv six

Log in as the askbot user previously created, and create a new virtual environment with virtualenv:

$ su - askbot
$ virtualenv unixmen/

Activate this new virtual environment, by executing the following command:

$ source unixmen/bin/activate

Next, install Askbot and other required packages with pip:

$ pip install six askbot psycopg2
Testing Askbot

Last step is to test the Askbot installation. Create a new directory, being sure to not use “askbot” as its name.:

$ mkdir testing

Initialize a new Askbot project by executing the following commands:

$ cd testing
$ askbot-setup

During this process, Askbot will ask for some information required to create the project, for example those related to the database created with PostgreSQL.

At the end, generate the Django static files with the following python command:

$ python manage.py collectstatic

Generate the database:

$ python manage.py syncdb

So, Askbot has been installed and the testing project configured. Test it with runserver:

$ python manage.py runserver

With a web browser, go to the server IP address, and you should see a forum page.


In this tutorial we have seen how to install and configure Askbot on a server powered by CentOS 7. Of course, this is just the first step in the realization of a full Q&A website.

The post Askbot: How To Install and Configure the Questions and Answers Framework on CentOS 7 appeared first on Unixmen.

Read Full Article
Visit website
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

What is Docker Compose

Docker Compose is a tool for running multi-container Docker applications. To configure an application’s services with Compose we use a configuration file, and then, executing a single command, it is possible to create and start all the services specified in the configuration.

Docker Compose can be useful for many different projects, including:

Development: with the Compose command line tools we create (and interact with) an isolated environment which will host the application being developed.
By using the Compose file, developers document and configure all of the application’s service dependencies.

Automated testing: this use case requires an environment for running tests in. Compose provides a convenient way to manage isolated testing environments for a test suite. The full environment is defined in the Compose file.

Docker Compose was made on the Fig source code, a community project now unused.

In this tutorial we will see how to install Docker Compose on a CentOS 7 server.

Install Docker

First of all, install Docker. The easiest way to install it is to download an installation script provided by the Docker project:

$ wget -qO- https://get.docker.com/ | sh

One required step is to configure correctly the user for Docker. In particular, add the user to the docker group, by executing the following command:

# usermod -aG docker $(whoami)

Log out and log in again to update the user groups list.

Next, enable Docker to start at boot time:

# systemctl enable docker

Start Docker:

# systemctl start docker
Install Docker Compose

Once Docker has been installed, install Docker Compose. First of all, install the EPEL repository by executing the command:

# yum install epel-release

Next, install python-pip:

# yum install -y python-pip

At this point, it is possible to install Docker Compose by executing a pip command:

# pip install docker-compose

Upgrade also all the Python packages on CentOS 7:

# yum upgrade python*

Check Docker Compose version with the following command:

$ docker-compose -v

The output should be something like this:

docker'compose version 1.16.1, build 6d1ac219
Testing Docker Compose

The Docker Hub includes a Hello World image for demonstration purposes, illustrating the configuration required to run a container with Docker Compose.

Create a new directory and move into it:

$ mkdir hello-world
$ cd hello-world

Create a new YAML file:

$ $EDITOR docker-compose.yml

In this file paste the following content:

 image: hello-world

Note: the first line is used as part of the container name.

Save and exit.
Run the container

Next, execute the following command in the hello-world directory:

$ sudo docker-compose up

If everything is correct, this should be the output shown by Compose:

Pulling unixmen-compose-test (hello-world:latest)...
latest: Pulling from library/hello-world
b04784fba78d: Pull complete
Digest: sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26ff74f
Status: Downloaded newer image for hello-world:latest
Creating helloworld_unixmen-compose-test_1 ... 
Creating helloworld_unixmen-compose-test_1 ... done
Attaching to helloworld_unixmen-compose-test_1
unixmen-compose-test_1 | 
unixmen-compose-test_1 | Hello from Docker!
unixmen-compose-test_1 | This message shows that your installation appears to be working correctly.
unixmen-compose-test_1 | 
unixmen-compose-test_1 | To generate this message, Docker took the following steps:
unixmen-compose-test_1 | 1. The Docker client contacted the Docker daemon.
unixmen-compose-test_1 | 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
unixmen-compose-test_1 | 3. The Docker daemon created a new container from that image which runs the
unixmen-compose-test_1 | executable that produces the output you are currently reading.
unixmen-compose-test_1 | 4. The Docker daemon streamed that output to the Docker client, which sent it
unixmen-compose-test_1 | to your terminal.
unixmen-compose-test_1 | 
unixmen-compose-test_1 | To try something more ambitious, you can run an Ubuntu container with:
unixmen-compose-test_1 | $ docker run -it ubuntu bash
unixmen-compose-test_1 | 
unixmen-compose-test_1 | Share images, automate workflows, and more with a free Docker ID:
unixmen-compose-test_1 | https://cloud.docker.com/
unixmen-compose-test_1 | 
unixmen-compose-test_1 | For more examples and ideas, visit:
unixmen-compose-test_1 | https://docs.docker.com/engine/userguide/
unixmen-compose-test_1 | 
helloworld_unixmen-compose-test_1 exited with code 0

Docker containers only run as long as the command is active, so the container will stop when the test finishes running.


In this tutorial we have seen how to install and test Docker Compose on a CentOS 7 server, and used the Compose file in the YAML format.

The post Docker Compose: How To Install on CentOS 7 appeared first on Unixmen.

Read Full Article
Visit website
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Introduction – Sensu Monitoring

Sensu is a free and open source tool for composing a monitoring system. It is entirely written in Ruby. It uses RabbitMQ to handle messages and Redis to store its data.
Sensu focuses on composability and extensibility, allowing to reuse monitoring checks and plugins from tools like Nagios and Zabbix.
This framework was designed to work with software like Puppet, Chef and Ansible, and it does not required additional workflow.
As stated in the documentation, “all versions of Sensu (including Sensu Enterprise) are based on the same core components and functionality, which are provided by the Sensu open-source software project and collectively referred to as Sensu Core. Sensu Core provides multiple processes, including the Sensu server (sensu-server), Sensu API (sensu-api), and Sensu client (sensu-client).

Installer packages are available for most modern operating systems via native installer packages (e.g. .deb, .rpm, .msi, .pkg, etc) which are available for download from the Sensu website, and from package manager repositories for APT (for Ubuntu/Debian systems), and YUM (for RHEL/CentOS).”

In this tutorial we will show how to install Sensu on an Ubuntu 16.04 server.

Install RabbitMQ

RabbitMQ runs on top of Erlang, so, first of all, we will install Erlang in our server.

Erlang is not available in Ubuntu repositories, but provides its own. Let’s add it and the Erlang public key to the trusted key list, by executing the following command:

$ wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
# dpkg -i erlang-solutions_1.0_all.deb
$ wget -O- https://packages.erlang-solutions.com/ubuntuerlang_solutions.asc | sudo apt-key add -

Next, update the repositories list with the following apt command:

# apt-get update -y

Once apt has updated its list, it is possible to install Erlang by executing the following command:

# apt-get install socat erlang-nox

At this point, we can download and install RabbitMQ. As we have done for Erlang, first of all it is required to add the RabbitMQ repository:

$ wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.10/rabbitmq-server_3.6.10-1_all.deb
# dpkg -i rabbitmq-server_3.6.10-1_all.deb

Update the repositories list with the following command:

# apt-get update

Finally, we can install RabbitMQ server with the following apt command:

# apt-get install rabbitmq-server

Once the installation is complete, start RabbitMQ and enable it to start at boot time. Execute the commands:

# systemctl start rabbitmq-server
# systemctl enable rabbitmq-server
Create vhost and User for Sensu

Next, we need to create a RabbitMQ vhost and user for Sensu. You can do this by running the following command:

# rabbitmqctl add_vhost /sensu
# rabbitmqctl add_user sensu your-password
# rabbitmqctl set_permissions -p /sensu sensu ".*" ".*" ".*"

At this point, we can install the Redis server.

Install Redis Server

As anticipated in the introduction, Sensu uses Redis server to store data.
By default, Redis is available in Ubuntu repository, so we can install it by executing the following command:

# apt-get install redis-server apt-transport-https -y

Once the installation is complete, we can start Redis and enable it to start at boot time:

# systemctl start redis-server
# systemctl enable redis-server
Install and Configure Sensu

The next step is to install Sensu. It is not available in Ubuntu repositories, but, as we said in the introduction, the project provides its own repository for Ubuntu. Add Sensu public key and repository to apt repositories list.

First of all, add the key, by executing the following gpgcommand:

$ wget -q https://sensu.global.ssl.fastly.net/apt/pubkey.gpg -O- | sudo apt-key add -

Next, we need to add the Sensu repository. Create a sensu.list file in /etc/apt/sources.list.d directory:

# $EDITOR /etc/apt/sources.list.d/sensu.list

In this file, paste the following content:

deb https://sensu.global.ssl.fastly.net/apt xenial main

Save and exit. Update the repositories list:

# apt-get update

Finally, install Sensu:

# apt-get install sensu
Configure Sensu

Once the installation is finished, we need to configure Sensu for using with RabbitMQ and Redis. By default, Sensu will load configuration from /etc/sensu/conf.d/ directory. This is where we will create the RabbitMQ, Redis, and Api configuration files.

For the RabbitMQ part, create a rabbitmq.json file in /etc/sensu/conf.d:

# $EDITOR /etc/sensu/conf.d/rabbitmq.json

To connect Sensu to RabbitMQ, paste the following content in the opened file:

 "rabbitmq": {
     "host": "",
     "port": 5672,
     "vhost": "/sensu",
     "user": "sensu",
     "password": "your-password"

Save and exit.

Next, in the same way, create the redis.json file:

# $EDITOR /etc/sensu/conf.d/redis.json

There, paste the following content:

 "redis": {
 "host": "",
 "port": 6379

Save and exit

Next, create the api.json file:

# nano /etc/sensu/conf.d/api.json

Paste the following lines:

 "api": {
 "host": "localhost",
 "bind": "",
 "port": 4567

Save and exit.

Install and Configure Uchiwa Dashboard

By default, after the installation Sensu does not provide the Dashboard to monitor Sensu through a user-friendly web interface.

The framework was originally designed as an API-based monitoring solution, enabling operations teams to compose monitoring solutions where Sensu provides the monitoring instrumentation, collection of telemetry data, scalable event processing, comprehensive APIs and plugins for sending data to dedicated dashboard solutions. However, as the project matured, it was natural to work on a monitoring interface. As a result, today there are two dashboards: Uchiwa (for Sensu Core users), and the Sensu Enterprise Dashboard (for Sensu Enterprise customers).
In this tutorial, we will install the Uchiwa Dashboard.

First, add the public key by executing the following command:

$ wget -q https://sensu.global.ssl.fastly.net/apt/pubkey.gpg -O- | sudo apt-key add -

Next, add a Uchiwa repository by creating the uchiwa.list file inside the /etc/apt/sources.list.d directory:

# $EDITOR /etc/apt/sources.list.d/uchiwa.list

Here, paste:

deb https://sensu.global.ssl.fastly.net/apt xenial main

Save and exit.
Next, update the repositories list with the following command:

# apt-get update

Once apt has updated its repositories list, we can install Uchiwa by executing the following command:

# apt-get install uchiwa
Configure Uchiwa

Once the installation is finished, create a configuration file for Uchiwa:

# nano /etc/sensu/conf.d/uchiwa.json

Here, paste the following content:

{"sensu": [      { "name": "Sensu",        "host": "localhost",        "port": 4567, "timeout": 10      }   ],   "uchiwa": {        "host": "",        "port": 3000,       "refresh": 10        }  }

Save and exit.

Finally, restart Sensu and Uchiwa and enable them to start at boot time:

# systemctl start sensu-server
# systemctl enable sensu-server
# systemctl start sensu-api
# systemctl enable sensu-api
# systemctl start sensu-client
# systemctl enable sensu-client
# systemctl start uchiwa
# systemctl enable uchiwa
Configure UFW Firewall

Uchiwa listens on port 3000, so we need to allow it through the UFW firewall. Execute the following command:

# ufw allow 3000

This concludes the tutorial. We have seen how to install and configure Sensu and the Uchiwa Dashboard  on a server running Ubuntu 16.04.

The post Monitoring: How To Install Sensu on Ubuntu 16.04 Server appeared first on Unixmen.

Read Full Article
Visit website
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 


Starting with Chrome 56, the browser developed by Google marks non-secure pages containing password and credit card input fields as Not Secure in the URL bar. It was almost one year ago, when the Mountain View giant announced this choice.
Of course, everybody knows that secure is better then insecure; but in this case, the big problem with HTTP is that it lacks a system for protecting communications between clients and servers. This exposes data to different kinds of attacks, for instance, the “Man in the middle” (MIM), in which the attacker intercepts your data. If you are using some transaction system with your bank, using credit card infos, or just entering a password to log in to a web site, this can become very dangerous.
This is why HTTPS exists (HTTP over TLS, or, HTTP over SSL, or, HTTP Secure).
If you are on Unixmen, you probably know what this means: SSL/TLS ensures encrypted connections.
So, if your job is to keep a web server up and running on, you should switch to HTTPS.
To encrypt the traffic between server and client, web servers use SSL certificates. Let’s Encrypt helps in obtaining and installing a trusted certificate for free.

In this tutorial we will see how to secure an Apache Web Server on Ubuntu 16.04 using Let’s Encrypt.

Install Let’s Encrypt

Let’s Encrypt provides a client software which will fetch certificates almost automatically. This software is called Certbot, and the developers have their Ubuntu repository with up to date versions.

So, first of all, we will add the repository:

# add-apt-repository ppa:certbot/certbot

Next, update apt packages list:

# apt-get update

At this point, install Certbot:

# apt-get install python-certbot-apache
Install SSL Certificate

Once the Certbot client is installed, we can use it to obtain and install a new certificate for our server. It is possible to use a single certificate for many subdomains (or even domains). This can be done just passing all the domains as certbot argument.

# certbot --apache -d www.example.com -d example.com 

Certbot will present a step-by-step process to customize certificate options, and to enter information like email address. This last one will be used for key recovery. During the process it is possible to choice between which protocol to enable: both HTTP and HTTPS or HTTPS alone, which means that all requests will be automatically redirected. Of course, the best choice is to use only HTTPS, unless there are serious reasons to use unencrypted traffic to your server.

Testing Certificate

To verify the status of the SSL certificate, just go to the following link with a browser:

Certificates Renewal

Let’s Encrypt certificates last for 90 days, so it’s up to you to renew. Using Certbot, you can test the automatic renewal system with this command:

certbot renew --dry-run

If it works, you can add a cron or systemd job to manage automatic renewal.


We have seen how easy can be to install a SSL certificate on an Apache Web Server, running on top of Ubuntu 16.04, by using the software client provided by Let’s Encrypt. At this point, if you go with your browser to https://www.example.com or https://example.com you will see that the site will be correctly served through HTTPS.

The post Let’s Encrypt: Secure Apache Web Server on Ubuntu 16.04 appeared first on Unixmen.

Read Full Article
Visit website
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 


TaskBoard is a free and open source software, inspired by the Kanban board, for keeping track of tasks.

Kanban is a technique for visualizing the flow of work and organizing projects. In particular, in software development it provides a visual process management system to help in deciding how to organize production.

As you can see in the image above, this software makes it easy to keep track visually of the evolution of your projects.

TaskBoard features:

  • Free, Open-Source (MIT License), and Self-Hosted
  • Easy installation
  • Unlimited boards (projects)
  • Customize columns within boards and persistent expand/collapse per user
  • Items allow custom colors, categorization, Markdown descriptions, attachments, and comments
  • Items display complete history of activities
  • Full history of all board activity for admins
  • Easy customization
  • Basic User management (admin, and regular users)
  • No external dependencies
  • Creates SQLite database on first use
  • RESTful API
  • Very limited dependencies

This tutorial will explain how to install it on CentOS 7.

Install Apache Web Server

First of all, on your CentOS 7 server install Apache, by executing the following command:

# yum install httpd

Once the installation is finished, start Apache and enable it to run at boot time:

# systemctl start httpd
# systemctl enable httpd
Install PHP

Being that TaskBoard is written in PHP, we must install it. Since it requires PHP5+, we will install PHP7 by using the Webtatic repository.

First, install the EPEL repository, which is required by Webtatic:

# yum install epel-release


# yum update

Now, it is possible to install the Webtatic repository by executing the following commands:

# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
# yum update

Once the repository is ready, and yum can use it, install PHP 7.1 and the extensions required by TaskBoard:

# yum install php71w php71w-gd php71w-json php71-readline php71w-cli php71w-sqlite3
Install SQLite

TaskBoard uses SQLite as a database, which means that we can use it without having to install MySQL or other “big” databases.

SQLite can be installed with the following yum command:

# yum install sqlite
Install TaskBoard

TaskBoard installation is really very easy, as anticipated by the lengthy features list presented in the introduction. In fact, it just requires that you download and extract the TaskBoard archive. Go to the Apache web root directory:

# cd /var/www

Here, download the archive:

# wget https://github.com/kiswa/TaskBoard/archive/master.zip

Unzip it:

# unzip master.zip

unzip will extract the archive to a directory named TaskBoard-master. Rename it (optional) :

# mv TaskBoard-master taskboard

Through Composer, install the required dependencies:

./taskboard/build/composer.phar install

Next, change the taskboard owner to the apache user:

# chown -R apache:apache /var/www/taskboard
Create a Virtual Host

Create a new Virtual Host file for TaskBoard:

# $EDITOR /etc/httpd/conf.d/board.example.com.conf

In this file, paste the following content:

<VirtualHost *:80>
    ServerAdmin admin@example.com
    DocumentRoot "/var/www/taskboard"
    ServerName board.example.com
    ServerAlias www.board.example.com
    <Directory "/var/www/taskboard">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    ErrorLog "/var/log/httpd/board.example.com-error_log"
    CustomLog "/var/log/httpd/board.example.com-access_log" combined

Restart Apache:

# systemctl restart httpd
Finishing Installation

The last step is to finish installation through a web browser.  Go to the URL http://board.example.com.

Log in using admin as both username and password. Once you are logged in, change the administrator password by going in the Settings page.


We have seen how to install TaskBoard on CentOS 7. This Kanban-based application will surely help many people in organizing their projects workflow.


The post TaskBoard: Kanban-based Software on CentOS 7 appeared first on Unixmen.

Read Full Article
Visit website
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 
Unixmen by Giuseppe Molica - 7M ago


WordPress is a famous content management system based on PHP and MySQL, distributed under the terms of the GNU GPLv2 (or later). In most cases it is installed by using Apache or NGINX as web servers, or, as we explained in this tutorial, it can run on an isolated environment like Docker containers.

Alongside these choices, there is a new web server which is rapidly gaining popularity: Caddy.

Caddy (or Caddy web server), is an open source, HTTP/2 web server which enables HTTPS by default, without requiring external configuration. Caddy also has a strong integration with Let’s Encrypt.

This tutorial explains how to install and configure WordPress on top of your Caddy web server, installed following our guide.

Install PHP

As we said in the introduction, WordPress requires a web server, MySQL and PHP. First of all, install PHP and the extensions required by WordPress, by executing the following command:

# apt-get install php7.0-fpm php7.0-mysql php7.0-curl php7.0-gd php7.0-mbstring php7.0-mcrypt php7.0-xml php7.0-xmlrpc

Verify that the PHP was correctly installed by checking its version:

$ php -v
Install and Configure MariaDB

MariaDB is also available in the repository, so just use apt:

# apt-get install mariadb-client mariadb-server

MariaDB is a MySQL fork, and it uses its name for the systemd service:

# systemctl start mysql

Set MariaDB root password to secure your database:

# mysql_secure_installation

You will be asked for the following configuration parameters:

Enter current password for root (enter for none): PRESS ENTER

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

Once that step is complete you can access the MariaDB database with your password:

$ mysql -u root -p
Create New Database and User

Start the MariaDB shell:

$ mysql -u root -p

Use the MariaDB prompt to create a new database for WordPress. In this tutorial, we use wordpressdb as the database name, and wordpressusr as the username for the WP installation. So our code looks like this:

mysql> CREATE DATABASE wordpressdbDEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
mysql> CREATE USER wordpressusr@localhost IDENTIFIED BY 'usr_strong_password'; mysql> GRANT ALL PRIVILEGES ON wordpressdb.* to wordpressusr@localhost IDENTIFIED BY 'usr_strong_password';

Next, you can flush privileges and exit:

mysql> EXIT;
Install WordPress

Downloading and installing WordPress is quite an easy process, which requires executing just the following commands:

# cd /var/www
# wget wordpress.org/latest.zip
# unzip latest.zip

Change WordPress permissions with:

# chown -R www-data:www-data wordpress

Rename the WordPress config file and edit it:

# cd wordpress
# mv wp-config-sample.php wp-config.php
# $EDITOR wp-config.php

Here, change the database informations, using those specified during the MariaDB configuration process:

DB_NAME = wordpressdb
DB_USER = wordpressusr
DB_PASSWORD = usr_strong_password
Configure Caddy and Start WordPress Installation Wizard

This tutorial assumes you installed Caddy web server already. Edit its configuration file:

# $EDITOR /etc/caddy/Caddyfile

In this file, paste the following content:

example.com {
    tls admin@example.com
    root /var/www/wordpress
    fastcgi / /run/php/php7.0-fpm.sock php
    rewrite {
        if {path} not_match ^\/wp-admin
        to {path} {path}/ /index.php?_url={uri}

Note: admin@example.com is the email address that will be used for Let’s Encrypt certificate request.

Restart Caddy:

# systemctl restart caddy

As a last step, with a web browser, go to your website. This will start the WordPress GUI installation wizard which will finish the installation process and give you access to the WordPress dashboard.


At the end of the previous steps, a new WordPress instance will run on top of this new, tiny and powerful web server. Caddy will require certificates from Let’s Encrypt and enable automatically HTTPS connections, without any other manual configuration.

The post WordPress on Ubuntu 16.04 With Caddy appeared first on Unixmen.

Read Full Article
Visit website

Read for later

Articles marked as Favorite are saved for later viewing.
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Separate tags by commas
To access this feature, please upgrade your account.
Start your free year
Free Preview