How to install and configure fail2ban on CentOS 7

Fail2ban is available through the EPEL project. So it needs to be installed first.

Install

sudo yum install epel-release
sudo yum install fail2ban
sudo systemctl enable fail2ban
sudo systemctl start fail2ban
sudo systemctl status fail2ban

Configure

Configuration files is located in the /etc/fail2ban directory. Leave the jail.conf as default and create your own config file called /etc/fail2ban/jail.d/jail.local. The values defined in jail.local will take precedent over jail.conf.

sudo touch /etc/fail2ban/jail.d/jail.local
sudo vim /etc/fail2ban/jail.d/jail.local

add the content to it as needed. below is a sample content

[DEFAULT]
# Ban hosts for one hour:
bantime = 3600

# Override /etc/fail2ban/jail.d/00-firewalld.conf:
banaction = iptables-multiport

[sshd]
enabled = true

[nginx-http-auth]
enabled = true
sudo systemctl restart fail2ban
sudo systemctl status fail2ban

Monitor

sudo fail2ban-client status
sudo fail2ban-client status jail_name
sudo tail -F /var/log/fail2ban.log

How to extend partition size in Centos7

I have a local OS repository that is used by my local machines to get the Centos updates from.

I realised it has stopped working and it turned out that the disk is full.

The machine is hosted on a VMWare ESXi 6.7 server. Below are the steps needed to go through to get the partition size extended.

Continue reading →

How to install and configure Asciidoctor PDF

What is AsciiDoc

From asciidoc.org

AsciiDoc is a text document format for writing notes, documentation, articles, books, ebooks, slideshows, web pages, man pages and blogs. AsciiDoc files can be translated to many formats including HTML, PDF, EPUB, man page.

AsciiDoc is highly configurable: both the AsciiDoc source file syntax and the backend output markups (which can be almost any type of SGML/XML markup) can be customized and extended by the user.

asciidoc.org
Continue reading →

How to upgrade PostgreSQL-server to 9.6

Postgresql Logo

If you have followed my posts on how to install Jira, Confluence and Bitbucket in past, you probably have ended up installing Posgresql-server version 9.2. That version still is the latest version that Centos7 has on its official repository.

The problem is Atlassian dropped support for that version few months back but you still could install the updates. Last month when I updated to the latest version of Jira (7.11.0), I had an oops!! moment when server failed to start due to unsupported database server. Luckily I had a recent full back-up of the server and could recover easily.

Continue reading →