Install Mariadb on CentOS 7

MariaDB is an open-source relational database management system, backward compatible, binary drop-in replacement of MySQL. It is developed by some of the original developers of the MySQL and by many people in the community. With the release of CentOS 7, MySQL was replaced with MariaDB as the default database system.

If you, for any reason need to install MySQL, check the How to Install MySQL on CentOS 7 tutorial. If your application does not have any specific requirements, you should stick with MariaDB, the default database system in CentOS 7.

In this tutorial we will show you how to install the latest version of MariaDB on CentOS 7 using the official MariaDB repositories.

Prerequisites

Make sure you are logged in as a user with sudo privileges before proceeding with the tutorial.

Install MariaDB 5.5 on CentOS 7: The version of the MariaDB server provided in default CentOS repositories is version 5.5. This is not the latest version though, but it is quite stable.

Follow the steps below to install and secure MariaDB 5.5 on CentOS 7:

Install the MariaDB package using the yum package manager:

sudo yum install mariadb-server

Press y when prompted to proceed with the installation. Once the installation is complete, start the MariaDB service and enable it to start on boot using the following commands:

sudo systemctl start mariadbsudo systemctl enable mariadb

To verify that the installation was successful, check the MariaDB service status by typing:

sudo systemctl status mariadb

The output should show that the service is active and running: Continue reading “Install Mariadb on CentOS 7” »

Share

Set Time Zone on CentOS 7

Checking the Current Timezone

In CentOS and other modern Linux distros, you can use the timedatectl command to display and set the current system’s time and timezone.

timedatectl

The output below shows that the system’s timezone is set to UTC:

Local time: Wed 2019-02-06 22:43:42 UTC
Universal time: Wed 2019-02-06 22:43:42 UTC
RTC time: Wed 2019-02-06 22:43:42
Time zone: Etc/UTC (UTC, +0000)
NTP enabled: no
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a

The system timezone is configured by symlinking /etc/localtime to a binary timezone identifier in the /usr/share/zoneinfo directory. So, another option to check the timezone is to show the path the symlink points to using the ls command:

ls -l /etc/localtime
lrwxrwxrwx. 1 root root 29 Dec 11 09:25 /etc/localtime -> ../usr/share/zoneinfo/Etc/UTC

Changing Timezone in CentOS

Before changing the timezone, you’ll need to find out the long name for the timezone you want to use. The timezone naming convention usually uses a “Region/City” format.

To list all available time zones, you can either list the files in the /usr/share/zoneinfo directory or use the timedatectl command.

timedatectl list-timezones
...
America/Tijuana
America/Toronto
America/Tortola
America/Vancouver
America/Whitehorse
America/Winnipeg
...

Once you identify which time zone is accurate to your location, run the following command as sudo user: Continue reading “Set Time Zone on CentOS 7” »

Share

Reinstall VirtualBox on Ubuntu & CentOS

For Ubuntu

To remove virtualbox

sudo dpkg --list virtualbox-*
sudo apt autoremove --purge virtualbox*
dpkg -l virtualbox* | grep ^i

Remove all PPAs from sources.list and source.list.d directory

mkdir ~/apt-tmp
sudo mv /etc/apt/sources.list.d/* ~/apt-tmp

Make sure there is nothing except official repositories sources in /etc/sources.list. And update your sources:

sudo apt update

Now we can search to see which versions are available to install:

apt-cache madison virtualbox | grep -iv sources

Which produces an output like this:

virtualbox | 5.0.32-dfsg-0ubuntu1.16.04.2 | http://mirrors.kernel.org/ubuntu xenial-updates/multiverse amd64 Packages
virtualbox | 5.0.18-dfsg-2build1 | http://mirrors.kernel.org/ubuntu xenial/multiverse amd64 Packages

Then I would install the last version mentioned in xenial-updates: Continue reading “Reinstall VirtualBox on Ubuntu & CentOS” »

Share

Install ZFS on CentOS 7

Installing ZFS File System

ZFS File System support is not enabled by default on CentOS 7. That is not the only problem. ZFS is not available in the official package repository of CentOS 7. You have to install it from the official package repository of ZFS. I am installing this on a server running Centos 7.6. You may take a look at https://github.com/zfsonlinux/zfs/wiki/RHEL-and-CentOS for more details.

First check what version of CentOS 7 you’re using with the following command:

$ cat /etc/redhat-release

As you can see, I am using Centos 7.6

[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)

Now you have to add the official repository of ZFS on CentOS 7 with the following command:

yum install http://download.zfsonlinux.org/epel/zfs-release.el7_6.noarch.rpm

ZFS repository should be added.

There are two ways ZFS module can be loaded to the kernel, DKMS and kABI. The difference between these is that if you install DKMS based ZFS module, and then for some reason you update the kernel of your operating system, the ZFS kernel module must be recompiled again. Otherwise it won’t work. But the kABI based ZFS module has the upper hand in that it doesn’t require recompilation if the kernel of the operating system is updated. Continue reading “Install ZFS on CentOS 7” »

Share

Disable FirewallD and Enable Iptables on CentOS 7

Download and Install the Iptables Service

To begin your server’s transition, you need to download and install the iptables-service package from the CentOS repositories. Download and install the service files by typing:

sudo yum install iptables-services

This will download and install the systemd scripts used to manage the iptables service. It will also write some default iptables and ip6tables configuration files to the /etc/sysconfig directory.

Construct your Iptables Firewall Rules

Next, you need to construct your iptables firewall rules by modifying the /etc/sysconfig/iptables and /etc/sysconfig/ip6tables files. These files hold the rules that will be read and applied when we start the iptables service.

How you construct your firewall rules depends on whether the system-config-firewall process is installed and being used to manage these files. Check the top of the /etc/sysconfig/iptables file to see whether it recommends against manual editing or not:

sudo head -2 /etc/sysconfig/iptables

If the output looks like this, feel free to manually edit the /etc/sysconfig/iptables and /etc/sysconfig/ip6tables files to implement the policies for your iptables firewall:

output
# sample configuration for iptables service
# you can edit this manually or use system-config-firewall

Open and edit the files with sudo privileges to add your rules:

sudo nano /etc/sysconfig/iptables
sudo nano /etc/sysconfig/ip6tables

After you’ve made your rules, you can test your IPv4 and IPv6 rules using these commands:

sudo sh -c 'iptables-restore -t < /etc/sysconfig/iptables'
sudo sh -c 'ip6tables-restore -t < /etc/sysconfig/ip6tables'

If, on the other hand, the output from examining the /etc/sysconfig/iptables file looks like this, you should not manually edit the file: Continue reading “Disable FirewallD and Enable Iptables on CentOS 7” »

Share

Endian Installation USB Flash Drive

This lesson describes how to create an installation USB drive for image files provided by Endian and to verify the integrity of the image file. The procedure applies to Windows users with XP, Vista, or Windows7 systems.

Requirements

You need the following to complete this lesson:

  • .iso or .img image of an Endian Appliance.
  • md5sum of the image.
  • An USB Stick.

Warning
Some USB sticks may not work with Endian devices. In particular, some Endian hardware device might fail to recognise USB Sticks with size bigger the 2Gb. so you should try with one USB stick with smaller size.

Note: ISO image files
Starting with release 5.0, Endian releases installation images as .iso file, rather than .img. However, the following procedure and suggested software can be used also with .iso files.

It is assumed that you have an Endian image file and its correspondent md5sum checksum on your computer. This lesson takes as example an image of an edge 3.0 and its correspondent md5sum file saved in C:\:

In order to create the Endian installation USB flash drive you need to download an application that allows to burn img and iso images to USB flash drives disks, like win32 Disk Imager. Continue reading “Endian Installation USB Flash Drive” »

Share

Install Qemu Guest Agent on Proxmox

The qemu-guest-agent is a helper daemon, which is installed in the guest. It is used to exchange information between the host and guest, and to execute command in the guest.

In Proxmox VE, the qemu-guest-agent is used for mainly two things:

  • To properly shutdown the guest, instead of relying on ACPI commands or windows policies
  • To freeze the guest file system when making a backup (on windows, use the volume shadow copy service VSS).

Installation Host
You have to enable the guest-agent per VM, either set it in the GUI to “Yes” under options (see screenshot):

or via CLI:

qm set VMID --agent 1

Guest Linux
On Linux you have to simply install the qemu-guest-agent, please refer to the documentation of your system.

We show here the commands for Debian/Ubuntu and Redhat based systems:

Continue reading “Install Qemu Guest Agent on Proxmox” »

Share

Install Observium CentOS 7/Ubuntu 16.04/ Debian 9

Observium is an open source, low-maintenance, auto-discovering network monitoring tool for operating systems and network hardware. It supports Linux and Windows operating systems and network hardware like Cisco, Juniper, Brocade, Foundry, HP.

Observium is based on AMP (Apache, MySQL, and PHP) stack and it collects the monitoring metrics via SNMP protocol. It uses RRDtool to make a graph of metrics collected from SNMP. Observium can also collect data using CDP, FDP, LLDP, OSPF, BGP, and ARP protocols.

Observium comes with a simple yet powerful interface to monitor devices, and it’s alerting system can be highly customized to receive alerts over an email, IRC, slack and more.

This tutorial covers the installation of Observium on CentOS 7 / Ubuntu 16.04 / Debian 9 and collecting usage metrics from Linux machines via SNMP protocol.

Prerequisites

Log-in as the root user or switch to root user as commands we run during the installation process requires root privilege.

su -

OR

sudo su -

We first install Webtatic, OpenNMS, and EPEL repositories on CentOS 7 / RHEL 7.

rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
rpm -ivh http://yum.opennms.org/repofiles/opennms-repo-stable-rhel7.noarch.rpm

Install and Configure MySQL / MariaDB
Observium needs AMP stack, so install MariaDB as a database server, a fork of MySQL. Continue reading “Install Observium CentOS 7/Ubuntu 16.04/ Debian 9” »

Share

Zimbra 8.8 on CentOS 7

Before we proceed with Zimbra Collaboration Suite installation process, first login to your server console with root privileges and install the following packages:

# yum -y install unzip net-tools sysstat openssh-clients perl-core libaio nmap-ncat libstdc++.so.6 perl perl-core ntpl nmap sudo libidn gmp libaio libstdc++ unzip sqlite dnsmasq

Next, issue getenforce command to check if Selinux in enabled on your machine. In case the policy is set to Enforced disable it by issuing the below commands:

# getenforce
# setenforce 0
# getenforce

To completely disable Selinux on CentOS, open /etc/selinux/config file with a text editor and set the line SELINUX to disabled.

Assure that wget system utility is also installed on your system by issuing the following command:

# yum install wget

In order for Zimbra to function correctly you must set the local machine hostname and FQDN to point to your server IP Address by running the below commands from root account:

# hostnamectl set-hostname mail
# echo "192.168.0.14 mail.centos7.lan mail " >> /etc/hosts
# cat /etc/hosts

Replace the system hostname and FQDN values accordingly in order to match your own domain settings. Test the hostname and FQDN values by issuing the ping command against both records. Continue reading “Zimbra 8.8 on CentOS 7” »

Share

Add a New Disk Larger Than 2TB to An Existing Linux

I am using fdisk and parted utilities to do this configuration.

First list the current partition details using fdisk command as shown.

# fdisk -l
List Linux Partition Table
List Linux Partition Table

For the purpose of this article, I am attaching a hard disk of 20GB capacity, which can be followed for disk larger than 2TB as well. Once you added a disk, verify the partition table using same fdisk command as shown. Continue reading “Add a New Disk Larger Than 2TB to An Existing Linux” »

Share