CentOS 7 server VirtualBox tutorial. How to setup and install, part 5.

centos virtualbox horizontal

This is part 5 of the 6 part tutorial series that shows how to install CentOS 7 on VirtualBox.

Part 1 is on the installation and setup of VirtualBox.

Part 2 is on the installation of CentOS 7.

Part 3, part 4 and part 5 is on the configuration of CentOS 7 as well as installation of some nice to have third party software’s.

Part 6 is on general security.

We will continue to use Cmder throughout this tutorial. If you have not gone through the previous tutorials then I suggest you do that first.

We had a very quick look at the firewalld service in the previous tutorial. We made sure that SSH was allowed through port 22. Now we are going to make sure that HTTP, HTTPS and SMTP are also allowed because we will use these protocols and their ports in later tutorials so let us just go ahead and do that first.

We start off by checking if the firewalld service is running in the background.


In our case it seems to be running just fine.

Now we are going to add these three protocols that we mentioned.

For HTTP protocol:

For HTTPS protocol:

For SMTP protocol:


When you have successfully added them, let us list all allowed protocols just to be sure.


As you can see here they are all listed up and that means it is just as we wanted it.

Now what we have to do is to actually save/reload the settings so that they are in use.


Now everything about the firewall should be in order for now.

Next up we are going to install “Wget”. What is Wget? To explain it in the simplest way, it is basically what you use to download stuff from the internet with Linux.

The first thing we need to do is to check whether it is installed or not.


As we expected. It is not installed. To install Wget we simply run this command:


Now that Wget is installed, we can continue installing the rest.

We are now going to enable/install the EPEL repository.

EPEL stands for (Extra Packages for Enterprise Linux). It gives us access to a whole lot of software which I would argue is a must to have.

We use Wget to download the repository.


And then we have to install the repository.


And it’s that simple. If you want you can verify the repository list.


As we can see, the EPEL repository was successfully installed.

If you want to configure the EPEL repo later then you can do so with the file located in /etc/yum.repos.d/epel.repo.

So how do we actually use this EPEL repository? Let’s give an example of how to use it before we move on. Let say that we want a software called “htop” which enables us to monitor our server resources and running processes. We could then try to see if htop was available inside the EPEL repository.


As you can see from the picture, it did find a package called “htop”. This means we can install it using the EPEL repository.


Now that we have installed htop let us have a look at what it is. Simply run the command “htop”.

You will see a very cool and colorful program that looks like the picture below.


As you can see we have overview of the CPU usage, the Mem (memory) usage, and something called Swp which we will come back to later. It simply means “Swap file”, which you can think of as a “reserve backup memory” that is on the hard drive that will be used when the real memory is used up. This is usually used to prevent the server from crashing because of memory shortages.

The rest of the screen shows the running processes. If you hit F5 you will see a tree structure which shows main and sub processes.


Click CTRL + C to exit the program.

We will not use too much time on htop on this tutorial. But as you can see it is a very useful program to have. And you also saw how easy it was to install with the EPEL repository.

Now that we have EPEL repository covered, let us move forward.

Next up we are going to install something called “vim”. vim basically is a more “iMproved” vi. It is basically a more improved version of the text editor we are already using on this tutorial. Since that won’t hurt, let us go ahead and install it.


After it has completed installation we are going to do something that is very useful in linux, and that is alias.

What this does is that even if we open a file using “vi” it will treat it as “vim”. As the command suggest we just created an alias for “vim”, which is “vi”.

We will be opening files typing “vim” from now on even tho you can use “vi” since it is an alias.

One of the very important things to have in Linux is file compression and archiving.

Gzip and tar is already installed on this version of CentOS. Gzip is used to compress files, and tar is used to organize files into one file so it is very common to see files of the form .tar.gz.

CentOS 7 does not come with regular zip. So we need to install both “zip” and “unzip”.


And if we wish to pack files we need “unzip” aswel.


This is the end part 5.

In the next and last part of this tutorial series we will look at how to create public
and private keys to improve security. And I will also show you how you can transfer
files to your server in a very secure way using the SFTP protocol.

Click here for part 6.

Leave a Reply

Your email address will not be published. Required fields are marked *