Use PostgreSQL on CentOS 7

Create a New Role

From the postgres Linux account, you have the ability to log into the database system. However, we’re also going to demonstrate how to create additional roles. The postgres Linux account, being associated with the Postgres administrative role, has access to some utilities to create users and databases.

We can create a new role by typing:

  • createuser –interactive

This basically is an interactive shell script that calls the correct Postgres commands to create a user to your specifications. It will only ask you two questions: the name of the role and whether it should be a superuser. You can get more control by passing some additional flags. Check out the options by looking at the man page:

  • man createuser

(more…)

Read More

Install PostgresQL Centos 7

PostgreSQL (pronounced ‘post-gres-Q-L’) 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. PostgreSQL, or ‘Postgres’ as it is nicknamed, adopts the ANSI/ISO SQL standards together, with the revisions.

1. Install PostgreSQL

yum install postgresql.x86_64 postgresql-server

PostgreSQL should now be installed. (more…)

Read More

How To Use Cron To Automate Tasks

Installation

Almost all distros have a form of cron installed by default. However, if you’re using a system that doesn’t have it installed, you can install it with the following commands:

For Ubuntu/Debian:

apt-get update
apt-get install cron

For Cent OS/Red Hat Linux:

yum update
yum install vixie-cron crontabs

You’ll need to make sure it runs in the background too:

chkconfig crond on
service crond start

(more…)

Read More

Iptables log connection

Here is an example to log new tcp connections (port 22):

-A INPUT -m state –state NEW -m tcp -p tcp –dport 22 -j LOG –log-prefix “New Connection: ” –log-level 4

Here is an example to log any tcp connections:

iptables -A INPUT -m state --state NEW -j LOG --log-prefix "New Connection: "
iptables -A OUTPUT -m state --state NEW -j LOG --log-prefix "New Connection: "

 

Read More

How To Configure FreeIPA server On CentOS 7

FreeIPA stands for Free Identity Policy Audit.

FreeIPA is a solution for managing users, groups, hosts, services, and much, much more. It uses open source solutions with some Python glue to make things work. Identity Management made easy for the Linux administrator.

Inside FreeIPA are some common pieces; The Apache Web Server, BIND, 389DS, and MIT Kerberos. Additionally, Dogtag is used for certificate management, and sssd for client side configurations. Put that all together with some python glue, and you have FreeIPA. (more…)

Read More

How To Install MySQL / MariaDB on CentOS 7

MariaDB is a drop-in replacement for MySQL. It is easy to install, offers many speed and performance improvements, and is easy to integrate into most MySQL deployments. Answers for compatibility questions can be found at: MariaDB versus MySQL – Compatibility. MariaDB offers more storage engines than MySQL, including Cassandra (NoSQL, in MariaDB Version 10), XtraDB (drop-in replacement for InnoDB), and OQGRAPH (in MariaDB Version 10).

Pre-Flight Check
  • These instructions are intended for installing MariaDB on a single CentOS 7 node.
  • I’ll be working from a Liquid Web Self Managed CentOS 7 server, and I’ll be logged in as root.

(more…)

Read More

How to Extend/Reduce LVM

When do we need to reduce volume?

May be we need to create a separate partition for any other use or we need to expand the size of any low space partition, if so we can reduce the large size partition and we can expand the low space partition very easily by the following simple easy steps. (more…)

Read More

How to install OTRS 4 on CentOS 7

In this post I’m going to walk you through installing OTRS 4 on CentOS 7. The procedure will be very similar for Red Hat Enterprise Linux (RHEL) version 7 as this is binary compatible.

Please note that there are some differences between CentOS 6 and CentOS 7: it now ships with systemd and with firewalld so the instructions to install OTRS are pretty different.

Setting up your production server or migrating from one is something you don’t want to do every day. This means you better take a distribution that will receive security upgrades for a long time. This is why I would recommend CentOS version 7 over version 6 at this point in time. (more…)

Read More

Postfix Queue Management

If emails are getting delayed, its better to inspect postfix mail queues, coupled with postfix mail log.

Status/Shape of Mail Queue

Postfix maintains different queues for different purpose.active  and  deferred queues are of our interest.

Ideally, we should never have a mail in deferred queue.

qshape command will show shape of active mail queue by default. Ideally it should be as close as to empty since postfix sends email instantly!

qshape

(more…)

Read More