Install MongoDB on CentOS 7

Follow the steps below to install the latest stable version of MongoDB on your CentOS server :

Enabling MongoDB repository

To add the MongoDB repository to your system, open your text editor and create a new YUM repository configuration file named mongodb-org.repo inside the /etc/yum.repos.d/ directory:

nano /etc/yum.repos.d/mongodb-org.repo
name=MongoDB Repository

If you want to install an older version of MongoDB, replace each instance of 4.0 with your preferred version. Continue reading “Install MongoDB on CentOS 7” »


CentOS 7 XFS disk resizing

Couldn’t find any article that explained step by step how to resize the main disks volume in a CentOS 7 vm. In my example I started witha single disk of 8GB and expanded to 20GB. I have two partitions on disk sda

sda1 type Linux for boot
sda2 type Linux LVM for the remaining logical volumes

Space utilisation as following:

[root@vcd-c1-s1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 3.9G 8.8M 3.9G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/mapper/centos-root 6.2G 1.9G 4.4G 31% /
/dev/sda1 1014M 179M 836M 18% /boot
tmpfs 783M 0 783M 0% /run/user/0

We basically need to: Continue reading “CentOS 7 XFS disk resizing” »


Install webmin on Centos 7 using Yum

Create and open this new file using your text editor:

sudo vi /etc/yum.repos.d/webmin.repo

Then add these lines to the file to define the new repository:

nano /etc/yum.repos.d/webmin.repo
name=Webmin Distribution Neutral

Save the file and exit the editor. Continue reading “Install webmin on Centos 7 using Yum” »


Install wkhtmltopdf 0.12.5 on Centos 7

Install Dependencies

yum install fontconfig libXext freetype libpng zlib libjpeg-turbo libpng libjpeg openssl icu libX11 libXext libXrender xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi

Install wkhtmltopdf

sudo yum install -y


wkhtmltopdf google.pdf


Configure DomainKeys- DKIM (OpenDKIM) with Postfix on CentOS 7

OpenDKIM is method to digitally sign & verify emails on the mail servers using public & private keys. In other words opendkim implements the DKIM (DomainKeys Identified Mail) standard for signing and verifying email messages on a per-domain basis. DomainKeys are implemented to reduce the chances of outgoing mails to be marked as SPAM.

In this post we will demonstrate how to install & configure DomainKeys with postfix (MTA) on CentOS 7, i am assuming Postfix is already installed with following domain and hostname.

Hostname =
Domain =

Step:1 Set EPEL Repository using below rpm command

OpenDKIM package is not available in the default yum repositories but available in CentOS 7 EPEL repositories

[root@mail5 ~]# rpm -Uvh

Step:2 Install OpenDKIM Package using yum

[root@mail5 ~]# yum install -y opendkim

Step:3 Run below Command to create keys

Execute the below command to create public & private keys under folder “/etc/opendkim/keys” Continue reading “Configure DomainKeys- DKIM (OpenDKIM) with Postfix on CentOS 7” »


Setup mail server on centos 7 using postfix and dovecot

Installing packages

Step 1 » Assign hostname for the server using the below command.

[root@krizna ~]# hostnamectl set-hostname

Step 2 » Make a host entry with your IP in /etc/hosts file.

Step 3 » Now start installing packages.

[root@krizna ~]# yum -y install postfix dovecot

After package installation continue with postfix configuration. Continue reading “Setup mail server on centos 7 using postfix and dovecot” »


How to fix CentOS 5 or 6 error: YumRepo Error: All mirror URLs are not using ftp, http[s] or file

The error looks like-

And here goes the resolution (please carefully update/use the exact CentOS version you are using, in my case it was CentOS 6.9)

1. Go to /etc/yum.repos.d/ directory:

# cd /etc/yum.repos.d/

2. Make copy of original file:

# cp CentOS-Base.repo CentOS-Base.repo.old

3. Open and edit file with any text editor:

# vi CentOS-Base.repo looks

4. After editing it should looks like: Continue reading “How to fix CentOS 5 or 6 error: YumRepo Error: All mirror URLs are not using ftp, http[s] or file” »


Build a Centos 7 Repo

Install httpd

[root@www ~]# yum -y install httpd
# remove welcome page
[root@www ~]# rm -f /etc/httpd/conf.d/welcome.conf

Configure httpd. Replace server name to your own environment.

[root@www ~]# vi /etc/httpd/conf/httpd.conf
# line 86: change to admin's email address

# line 95: change to your server's name

# line 151: change

AllowOverride All
# line 164: add file name that it can access only with directory's name

DirectoryIndex index.html index.cgi index.php
# add follows to the end

# server's response header

ServerTokens Prod
# keepalive is ON

KeepAlive On

[root@www ~]# systemctl start httpd
[root@www ~]# systemctl enable httpd

Install other required packages.

[root@dlp ~]# yum -y install rsync createrepo

Continue reading “Build a Centos 7 Repo” »


Install MariaDB on CentOS 7

Start by adding the MariaDB YUM repository file MariaDB.repo for RHEL/CentOS and Fedora systems.

# vi /etc/yum.repos.d/MariaDB.repo

Now add the following lines to your respective Linux distribution version as shown.

On CentOS 7
name = MariaDB
baseurl =

Step 2: Install MariaDB in CentOS 7
Once MariaDB repository has been added, you can easily install it with just one single command.

# yum install MariaDB-server MariaDB-client -y

Continue reading “Install MariaDB on CentOS 7” »


Install WHMCS on CentOS 7

As you may know, WHMCS is the leading web hosting management and billing software that automates all aspects of your business from billing, provisioning, domain reselling and etc. In this article, we are going to install WHMCS 7.7.1 on CentOS 7.6.

We assume you have a valid WHMCS license and have downloaded its package from WHMCS download area.

Here are our environment OS and software versions:

  • OS: Centos 7.6 on VMware
  • WHMCS: 7.7.1
  • PHP: 7.2
  • Database: Mariadb 10.3
  • Web server: httpd 2.4

Here we start from a fresh minimal CentOS 7.6 installation.

1- Initial CentOS setup
Set correct time and date. here we use “Asia/Dhaka”:

# timedatectl set-timezone America/New_York

Change default root password:

# passwd

Set SELinux to permissive mode by editing /etc/selinux/config:

# vim /etc/selinux/config

Also to apply it immediately run: Continue reading “Install WHMCS on CentOS 7” »