Any work on server administration begins with the most obvious and mandatory process - installing the necessary OS, which is what we will do. Let's download and install CentOS 7 server in the minimal or netinstall configuration from a bootable USB flash drive or over the network on a regular disk or raid partition. Before that, let's do a little preparatory work and get acquainted with the details of our distribution, which may be useful in the future.
If you have a desire to learn how to work with Mikrotik routers and become a specialist in this field, I recommend following a program based on information from the official
MikroTik Certified Network Associate .
The course is worthwhile, read the link for all the details. There are free courses. A new version of Centos 8 has been released. I recommend using my article on this topic - Installing Centos 8.
CentOS 7 system requirements
On July 7, 2014, the release of the CentOS 7 distribution was released. Before installing it, it is recommended that you familiarize yourself with the system requirements.
You can view the full list of maximum and minimum system requirements in detail on the official wiki. I will give only the most important parameters: CentOS 7 system requirements
i386 architecture support | No |
Minimum amount of memory | 1GB |
Recommended amount of memory | 1GB per processor core |
Minimum disk space | 10GB |
Recommended disk space | 20GB |
Maximum file size (ext3) | 2TB |
Maximum file system size (ext3) | 16TB |
Maximum file size (ext4) | 16TB |
Maximum file system size (ext4) | 50TB |
This is the official data from the CentOS website. RHEL has the same ones, I checked. For me personally, everything works well on VDS even with 512MB of memory, I haven’t tried installing less, I think it will work with 256.
Linux Differences – Debian, Ubuntu, CentOS Comparison
Having asked myself the question of which distribution to choose for the newly matured ones I need, I once again come across the answer: “Whatever you know best, install it!” And only by sifting through a fairly significant amount of information can you get a somewhat clearer picture. Due to the circumstances, there were three distributions in my circle of choice: Debian, Ubuntu and CentOS. Well, let's try to figure out what's what.
- Owners and communities
As you know, Linux is a free and open source operating system. Hence the main reason for such a variety of images. Yes, there are also commercial versions. When purchasing such a product, you pay for branded packages and support, but not for the operating system itself. This is precisely what Red Hat was guided by when it organized the distribution of the CentOS Linux image under its roof and offered it to everyone who wanted to use Enterprise-class solutions for free. In fact, today the CentOS community is made up of Red Hat employees. The CentOS distribution is fully compatible with the RHEL distribution, and the technical difference is only in the presence of the trademark and design work. The project started in March 2004 and is currently one of the most popular server solutions due to its high stability and compatibility.
The Debian project is somewhat older. It was founded in August 1993 and was positioned as a completely non-profit project. Despite the opinions of skeptics, the system is still alive and thriving. According to the author, attention to the project is still not subsiding, primarily due to the development philosophy, large amount of free software and a stable kernel.
The Ubuntu system is a relative of Debian, rather a daughter. It was born in July 2005 thanks to Canonical, which to this day finances and controls the development of the project. Canonical's views on the development of the system, unlike many other Debian followers, remained true to the philosophy of distributing free software, and was also very loyal to criticism and additions. Thanks to this, the project is currently actively developing and supported by the community.
- Everything is so, but not so!
In general, managing any operating system (not just *nix) requires a very similar set of knowledge: working with the file system, network connections, services or daemons, application software packages. Speaking about the Linux family, of course, we mean a bunch of configuration files, a command line (although not necessarily), a basic folder structure in the root. However, each distribution has its own subtleties and nuances. For example: the well-known “BIND”, which resolves names to IP addresses in CentOS, is called “named”, and the “appache2” web server from Debian and Ubuntu has been transformed into “httpd” in CentOS. By the way, the default folder and file structure for appache in ubuntu is more reminiscent of the configuration for a large hoster, while the basic configuration of a web server in CentOS is suitable for hosting one corporate website and does not have such a string of config files. One is, of course, transformable into another, but not identical. Similar things are observed when working with commands: for example, when working with repositories, Debian uses apt-get, while in CentOS we use yum. The essence is the same, but such a zoo of commands often confuses an inexperienced Linux user.
- Supported hardware, packages and versions used
So, the reasonable question becomes: what to choose? (Especially if you don’t care which system you start getting acquainted with.) The author recommends that you think carefully about what tasks you will use the server for, and what resources you have for this. If you have physical hardware that you intend to use in your project, the first step is to check it in the list of supported hardware for each distribution. From experience, Debian has fewer hardware issues than CentOS, despite the fact that the enterprise distribution is constantly expanding the horizons of supported hardware. Next, we consider in detail the required software and its versions. The standard CentOS repositories are quite sparse, so in maintenance (for example), it will probably be easier to use Debian and install an already built package than to build it manually (and in the future, possibly rebuild it when updating) for CentOS. And even though Ubuntu uses Debian repositories, due to the difference in approaches to software classification, it will be convenient to use Ubuntu, which is ahead of everyone in terms of package update speed. However, do not forget that a newer package does not always guarantee stability. In this matter it is up to you to decide. The author prefers to balance somewhere in the middle between new opportunities and proven, reliable solutions.
And for a snack about the versions. Below is a comparative table of releases of the distributions themselves. Draw your own conclusions.
Product | version | release date | code name |
Debian | 8.0 | April 2020 | Jessie |
7.0 | May 2013 | Wheezy | |
6.0 | February 2011 | Squeeze | |
5.0 | February 2009 | Lenny | |
4.0 | April 2007 | Etch | |
Ubuntu | 16.04 LTS | April 21, 2020 | Xenial Xerus |
14.04 LTS | April 17, 2014 | Trusty Tahr | |
12.04 LTS | April 26, 2012 | Precise Pangolin | |
10.04 LTS | April 29, 2010 | Lucid Lynx | |
8.04 LTS | April 24, 2008 | Hardy Heron | |
CentOS | 7 | July 7, 2014 | |
6 | July 20, 2011 | ||
5 | April 12, 2007 | ||
4 | March 9, 2005 | ||
3 | January 5, 2001 |
- Installation. Are there really any differences?
In the vast expanses of the Internet there are a lot of statements that installing one image is different from installing another; for some, the abundance of settings seems to be an advantage, but for others it greatly complicates the task. In the realities of our lives, installing a server is extremely unlikely to be entrusted to a blonde secretary, and a specialist performing the role of administrator must still have basic knowledge of file systems and disk layout, network settings, bootloaders and installed server roles. Therefore, installing any of the distributions should not cause any problems. Each of the systems has a GUI Installation mode, assessment of the convenience of which, however, is also quite subjective. Among the differences, it is worth noting that Debian has the most meager set of preconfigured roles, but how important this is directly for you is not for the author to decide.
- Security: root, SELinux and other scary words.
Even during the installation process of Ubuntu, you can notice its distinctive feature. The system does not require the use of the “root” account; instead, the “sudo” utility is used, which elevates the user’s rights to root, if the user, of course, has such privileges. According to the author, this approach is similar to User Account Control from Microsoft. It definitely increases the level of security and is useful during operation, although at first glance it complicates administration processes.
Systems for mandatory access of applications to system resources are present in all compared systems. CentOS successfully uses SELinux, while AppArmor is developed for Ubuntu, which is also successfully used on Debian if necessary. Which of them is better and whether they should be used at all and in what cases is a big topic for a separate article, so it’s not worth dwelling on this in detail now.
- Resource consumption and load testing
The minimum system resource requirements are shown in the table below:
Memory (minimal) | HDD (minimal) | |
Debian | 128 Mb | 2 Gb |
Ubuntu | 128 Mb | 0.5 Gb |
CentOS | 1024 Mb | 10 Gb |
According to the tests conducted (several examples of test results can be found here and here), out of the box Debian and Ubuntu are somewhat ahead of CentOS in terms of web server speed; in testing database performance, everything very much depends on the database server used and its version.
- Integration with other systems
Everything here is quite logical. In order to carry out integration, it is necessary to have close contacts between the developers of the integrated systems. Of course, it is easier to establish contact with a group of official representatives than with the community. This conclusion is confirmed by practice: CentOS (as an analogue of RedHat) was one of the first to be supported in Microsoft virtualization systems. Also, CentOS integrates better than others with ActiveDirectory. However, if you already have several Debian servers, then it may not always make sense to deploy CentOS, even if some integration is required. Perhaps, in the long run, the labor costs of integration will be less than the labor costs of maintaining an operating system that is different from all the others.
In general, summing up everything described above and trying to answer the question asked at the very beginning of the article, we can say that you need to choose a Linux image according to your tasks. Only by first assessing and weighing all the requirements for the hardware platform, software, surrounding infrastructure and administrative skills can you make the right choice. There is no clear right solution, and there will always be some shortcomings. But, in the firm belief of the author, these shortcomings can be eliminated with the help of additional settings or solutions. And if the labor costs for correcting deficiencies exceed expediency, simply neglect them. After all, you already have enough arguments to choose your solution.
And if you still haven’t decided, then we can help you select, install and configure the desired Linux OS, and subsequently provide administration services, details
There are no similar articles.
Types of CentOS 7 iso images
The CentOS release contained several types of iso images.
A detailed description of each of them is presented in the table: CentOS 7 editions
CentOS-7-x86_64-DVD | This DVD image contains all the packages that can be installed using the installer. Recommended for most users. |
CentOS-7-x86_64-NetInstall | This NetInstall image is for network installation and recovery. The installer will ask where the packages will be installed from. Convenient to use if you have a local package repository. |
CentOS-7-x86_64-Everything | This Everything image contains the full set of CentOS 7 packages. It can be used to install or update a local mirror. This image requires a double-sided DVD or an 8GB flash drive. |
CentOS-7-x86_64-LiveGNOME CentOS-7-x86_64-LiveKDE | These two images are LiveCD CenOS 7. Depending on the name, one or another graphical shell is used. They are designed for testing the CentOS 7 environment. They are not installed on your hard drive unless you force it. The set of installed software cannot be changed; this can only be done on the installed operating system using yum. |
CentOS-7-x86_64-Minimal | Using this Minimal image, you can install a basic CentOS system with a minimum set of packages necessary for the system to function. Everything else can be installed later using yum. The set of packages in this image will be the same as on the DVD when choosing the minimal installation. |
I usually use either a minimal image or netinstall .
Basic setup of CentOS 8 after installation
The basic setup of CentOS 8 is practically the same as the setup of CentOS; I make the basic settings the same on all servers.
CentOS 8: Installing updates and admin tools
As noted earlier, in CentOS 8 dnf came to replace yum .
Dnf is the next generation of YUM RPM based package manager for Linux distributions . dnf previously Fedora distributions , and now in CentOS 8 .
The first action I perform on the newly installed server is updating the system:
dnf update -y
If the image is fresh, then most likely you will not have update packages as in my case:
[ [email protected] var]# dnf update
Last metadata expiration check: 0:21:47 ago on Wed 09 Oct 2019 02:36:45 PM +06. Dependencies resolved. Nothing to do. Complete!
If you find any updates, be sure to install them.
The next step is to connect the EPEL and install the necessary utilities for convenient server administration:
dnf install epel-release -y dnf install mc wget screen nano net-tools bind-utils curl lsof vim -y
For comfortable administration, this set of utilities is enough for me; you can install your usual utilities.
I do not enable automatic system updates, since I always install the necessary updates manually. If you want to set up automatic updates, install the dnf-automatic :
dnf install -y dnf-automatic
To check active system update jobs, enter:
systemctl list-timers *dnf-*
Disabling SELinux
At the initial stage, I always disable SELinux (you need to restart the server to apply the change):
nano /etc/sysconfig/selinux reboot
Disabling SELinux on the fly can be done with the command:
setforce 0
Network setup in CentOS 8
Since I configured the network during the system installation stage, configuration is not required at the moment (detailed article on setting up a network in CentOS). I just want to say that in CentOS 8 , the network is managed only through the Network Manager and the nmcl utility. Network-scripts are not supported by default. To be honest, in my work I always turned off NM and did not use it, for me it is not a convenient tool, now I will have to deal with it.
Checking network status:
[ [email protected] ~]# systemctl status NetworkManager
● NetworkManager.service — Network Manager Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2019-10-07 08:23:11 MSK ; 3h 37min ago Docs: man:NetworkManager(8) Main PID: 870 (NetworkManager) Tasks: 3 (limit: 5060) Memory: 4.7M CGroup: /system.slice/NetworkManager.service └─870 /usr/sbin/NetworkManager — no-daemon
Installing and changing hostname
If you did not specify the correct hostname during installation or simply want to change it, this can be done in several ways. Change it in the /etc/hostname or change it using the command:
hostnamectl set-hostname desired_hostname
Setting up firewalld on CentOS 8
Let's add to the trusted zones on firewalld the services necessary for initial work (SSH and HTTP/HTTPS):
firewall-cmd –-add-service=ssh firewall-cmd –permanent –-add-service=http firewall-cmd –permanent –-add-service=https
Setting the time and time zone (time-zone)
To view the current time and time-zone, you need to enter the date :
[ [email protected] var]# date
Wed Oct 9 13:03:00 MSK 2019
We specified the time-zone when installing the system itself, so we have time in Moscow. To change time-zone , you need to use the appropriate command:
timedatectl set-timezone Europe/Moscow
Where instead of Europe/Moscow you can indicate your option, for example:
[ [email protected] network-scripts]# date Mon Oct 7 12:46:09 MSK 2019
[ [email protected] network-scripts]# timedatectl set-timezone Asia/Almaty [ [email protected] network-scripts]# date
Mon Oct 7 15:46:22 +06 2019
chronyd is used to synchronize time , we will enable it and add it to startup via systemctl: systemctl start chronyd systemctl enable chronyd
[ [email protected] network-scripts]# systemctl status chronyd
● chronyd.service - NTP client/server Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2019-10-07 16:13: 48 +06; 9s ago Docs: man:chronyd(8) man:chrony.conf(5) Main PID: 31700 (chronyd) Tasks: 1 (limit: 5060) Memory: 1.1M CGroup: /system.slice/chronyd.service └─31700 /usr/sbin/chronyd
Setting history command in bash_history
To easily view the history, I always add a couple of lines to .bashrc so that later you can easily navigate the reports.
With the default setting, history looks like this:
[ [email protected] ~]# history
1 dnf repolist 2 dnf install epel-release
That is, we see what was running on the server, but we do not see the time and exact date, for me this is critical, since several specialists may have access to the servers. Therefore, let's bring history to a pleasant form:
Open the /root/.bashrc and add the necessary lines to it: nano /root/.bashrc
export HISTSIZE=10000 export HISTTIMEFORMAT=»%h/%d/%y — %H:%M:%S «
Now, when checking history, we see the exact execution time of a particular command:
[ [email protected] ~]# history
1 Oct/07/19 — 16:16:29 dnf repolist 2 Oct/07/19 — 16:16:29 dnf install epel-release
Download CentOS 7
download the currently latest version of CentOS 7.2.1511 in two ways:
- Via torrent network
- From the nearest mirror
I prefer to use CentOS Yandex Mirror as such a mirror:
Download CentOS 7
Torrent | Yandex Mirror | Size |
4G | ||
360M | ||
7G | ||
1G | ||
1G | ||
634M |
Let me remind you that there is no 32 bit or i386 All distributions are only x86_64 , that is, 64 bit .
Bootable USB flash drive for CentOS 7
Lately, I personally hardly use regular CDs, preferring bootable flash drives. They are more convenient, take up less space, and it is easier to update the distribution on them. But sometimes you have to go to the trouble of creating a bootable USB flash drive. For example, to create a bootable USB flash drive for CentOS 6, I used to use the unetbootin , but with version 7 this number did not work. The flash drive created in it does not allow you to install CentOS 7, since the installer itself at some point does not see the installation source on the flash drive.
But the free program Win32DiskImager came to the rescue. With its help, you can easily create a bootable USB flash drive for CentOS 7 . Here's how it's done:
- Download the program distribution kit.
- Download the CentOS 7 distribution. I used the Minimal .
- Insert a clean flash drive, run the program and specify the settings:
- Click Write and wait for the recording to finish.
- The CentOS 7 bootable USB flash drive is ready.
This is enough to create a flash drive. Now you can use it to install the operating system from a flash drive.
Linux distribution CentOS
CentOS (Community ENTerprise Operating System) is a free distribution of the Linux operating system based on the commercial Red Hat Enterprise Linux. The support period for each version is 10 years. New versions are released approximately every 2-3 years and are updated every 6 months.
CentOS supports the i386, x86_64 processor architecture, and the latest version (7.1 currently available) only supports x86_64.
To install on a server, of course, you don’t need a desktop environment, but if you are used to working in a graphical environment, then CentOS suggests you use GNOME or KDE .
CentOS can also be used as a workstation in your company, but few people use this distribution as an operating system for a home computer.
The distribution is popular and has a good large community, so it supports many languages, including Russian.
On a note!
For beginner Linux users, I recommend reading my book “Linux for Regular Users” - in it I talk about the basics of Linux in as simple a language as possible and how to use this operating system without the command line
Installing CentOS 7 from a USB flash drive
After creating a bootable USB flash drive, you can begin installation. We insert the flash drive into the server, specify USB as the boot source and start the computer. We are greeted with the initial CentOS installation menu:
Select the first item: Install CentOS 7 and press enter. After downloading the installer, we are greeted by a window with a choice of language that will be used during installation. I always choose English, it’s more familiar to me:
Next, a page is loaded with a selection of basic installation parameters. It will differ depending on the type of ISO image from which Centos is installed.
CentOS 7 netinstall
Installing Centos 7 from the netinstall differs from others in only one way. When preparing to install over a network, in the INSTALLATION SOURCE section, instead of a local source, you need to specify the path to an image located somewhere on the network. Obviously, before doing this, you need to configure the network and make sure that the computer has access to the Internet.
As a source for installation, I will use the Yandex mirror mentioned earlier. CentOS netinstall url - https://mirror.yandex.ru/centos/7/os/x86_64/
The screenshot shows the old url. After a series of updates it became irrelevant. The correct link is above in the text.
Specify the path and click Done. After checking the availability of the source, in the SOFTWARE SELECTION section you can select the set of software required for installation:
Then you can begin the installation by specifying all the other parameters that we discussed above.
CentOS 7 installation on raid
Now let's look at the most complex installation option. We will install CentOS 7 on a software raid. For example, let's take 2 disks and raid 1. All settings will be the same as we looked at earlier, except for one - INSTALLATION DESTINATION.
We connect 2 disks to the system, boot from the installation disk and go to the disk partitioning section. We see 2 hard drives. Select both and check the I will configure partition :
Click Done. A slightly crooked window for managing hard disk partitions opens.
Here we first delete all existing partitions:
And we create our own new ones by pressing the plus sign. We need to create 3 partitions: boot, swap and root /. Choose the partition sizes yourself based on your needs and RAM on the server. For the boot partition, 500MB is enough, for swap there is enough RAM. Everything else can either be filled with one root partition, or several can be created if necessary. Device Type set to RAID. Choose the file system type at your discretion. Which is better - xfs or ext4 depends on the specific situation. It is believed that xfs works better with large files, ext4 with a bunch of small ones. This is a topic for another discussion. RAID Level indicate RAID1.
It should look something like this:
Click Done when finished. In a new window, confirm the disk partition by clicking Accept Changes :
We set all other parameters as described above. Now you can start installing CentOS 7 on the software raid we just created.
During installation, you need to specify the root password, or create additional users. I recommend setting a password for users as needed.
After completing the installation on the raid, let's log in to the system and check the state of the array:
# df -h # cat /proc/mdstat
Let's look at the information about the root array:
# mdadm -D /dev/md126
Everything is fine, the server installation is complete. The raid section is functioning normally, ensuring server fault tolerance.
I highly recommend using Linux soft raid mdadm in your daily activities. It is much more reliable, clearer and more stable than controllers built into the motherboard. You should give preference to a hardware raid only if it is truly hardware, it has a battery, and it really increases server performance. In all other cases, I recommend using mdadm.
Let me remind you that this article is part of a single series of articles about the Centos server.
conclusions
In this article, we compared two distributions that are quite popular in their respective fields so that you can determine which is better for you, Ubuntu or CentOS. They are excellent systems and are well suited to the tasks for which they were designed. What distribution are you using? Ubuntu vs CentOS? Which one would you choose? Write in the comments!
It’s difficult to choose a system without first looking at it; I’m attaching two videos to the article with a quick overview of both operating systems:
Related posts:
- Comparison Ubuntu vs OpenSUSE
February 10, 2016
- Apt vs apt-get, what is the difference
May 4, 2016
- Performance of Ubuntu 16.04 vs Ubuntu 16.10
August 6, 2016
- Which is better Lubuntu or Xubuntu
May 25, 2017
Online course on Linux
If you have a desire to learn how to build and maintain highly available and reliable systems, I recommend that you take the online course “Administrator Linux. Professional" in OTUS. The course is not for beginners; to enroll you need basic knowledge of networks and installing Linux on a virtual machine. The training lasts 5 months, after which successful course graduates will be able to undergo interviews with partners. What this course will give you:
- Knowledge of Linux architecture.
- Mastering modern methods and tools for data analysis and processing.
- Ability to select a configuration for the required tasks, manage processes and ensure system security.
- Proficient in the basic working tools of a system administrator.
- Understanding of the specifics of deploying, configuring and maintaining networks built on Linux.
- The ability to quickly solve emerging problems and ensure stable and uninterrupted operation of the system.
Test yourself on the entrance test and see the program for more details.