Many do not even suspect that all services andthe services we use on the Web are based on exactly the same computers that work in our apartments, they are only set up in a completely different way, they can not boast of a beautiful graphical interface and are managed with the help of specialized teams. These computers are called servers. People who know, of course, know how to configure and "raise" their own server. Those who are new to this business need to study more than one forum in order to finally get used to it. One thing is for sure: to configure an inexpensive and stable server, you must choose the same inexpensive and stable foundation, namely, a Linux-based operating system. The choice of the majority falls on CentOS 7. This material contains a brief information on how to make the installation of CentOS 7 and create a base server on its basis.
What is CentOS?
CentOS is a Linux distribution, the mainwhose dignity is stability. This system, like the closest competitor Fedora, was built on the source code of the Red Hat Linux distribution kit. The latter, in turn, is an ideal tool for system administrators, which require predictability, stable operation and convenient management.
CentOS can not boast the latestversions of packages, unlike Fedora, but every system administrator will be only happy when Fedora or another modern distribution with its fresh packages "falls", and CentOS will continue to work quietly, regardless of the circumstances. This article briefly describes the configuration and installation of CentOS 7, the main features of the system and the working environment.
Download CentOS 7
Before installing CentOS 7, you must download the operating system distribution package on the official website.
There are several boot options:
- ISO file for writing to disk is ideal for most with a full system and graphical interface;
- ISO file for installation from hard disk and USB flash drive - the most complete package;
- ISO for minimum unloading - contains in itselfonly a basic operating system with a minimal set of packages and no GUI (on this version of the distribution you can "raise" the server without problems, without installing anything superfluous).
Among the boot files, you can find two"Live" disk image with two different working environments (KDE and Gnome). These images are suitable for those who want to test the system in the case before installing on the hard drive.
CentOS 7 Installation
Even if you select a minimal image, CentOS 7 prompts you to use the graphical interface to install the system on the hard drive.
This process takes place in 6 basic steps:
- Setting the date and time - at this stage it is enough to choose your time zone and the time will be set automatically.
- Setting the language and layout - you must select one main language and one additional system language, as well as specify the necessary keyboard layouts for them.
- Source installation - at this stage you can not change anything, then the files for installation will be taken from the media with the system.
- Software for installation - at this stage it is necessary to select the minimum software package, since we need to deploy the server without a desktop and a graphical interface.
- Installation location - at this stage, select the hard drive to be installed, as well as the markup.
- Internet setup - here you need to enter data about the connection to the Network.
Once the data is entered, it will be necessary to createprofile users and specify the root password. After the installation process is complete, the computer restarts and prompts you to start the new operating system.
Installing CentOS 7 Server
Here in brief we'll talk about how to deploy a universal server based on CentOS 7 with the minimum set of necessary tools that are required for its full-fledged work.
So, first you need to find the server itself.It can either be hired on the Web (from 250 rubles), or configured on the local machine. The only thing you need is the SSH data that will be used to log into the server. Take as an example the abstract mailing address [email protected] and the user name with the password is also centos.
Start the configuration by creating the user and granting him all the necessary rights:
- Add the user useradd centos;
- Create a unique password for it - passwd centos;
- We force the system to send root-mail to this user - vi / etc / aliases;
- We give the user the right to sudo with the visudo command (the command line will respond with a confirmation of the operation).
Next, you must specify the host name. This can be done with the command hostnamectl set-hostname server1.centos.net.
After that you need to disable the Firewall and SeLinux.It is necessary to do this in order to not accidentally deprive yourself of the rights to access the server. You can pause the operation of the Firewall using the systemctl stop firewalld and systemctl disable firewalld commands. The situation with SeLinux is a bit more complicated: you need to open the corresponding configuration file in the Vi text editor with vi / etc / selinux / config, find the line SELINUX = enabled there and replace it with SELINUX = disabled. Then you need to reboot the system.
The next step in the configuration is to install SSH.
To do this you need:
- Add the appropriate keys from the north with the ssh-copy-id command [email protected]
- Modify the port in the configuration file / etc / ssh / sshd_config on Port 222.
- Deny access to the server without Root rights by typing the line PermitRootLogin without-password.
- And reboot the server with systemctl restart sshd.
Also, you need to update all systems and install the epel and rpmforge repositories. To do this you need:
- Update all system elements with the yum update command.
- Download the new system components with the yum -enablerepo = cr update command.
- If there are not enough existing components, you candownload more modern versions of epel and rpmforge, for this, enter the command yum -y install * the repository address where the required software version is stored * (a suitable repository can be easily found on profile resources).
Verify services, configure Apache and PHP
To install additional components in the existing server frame, you will need to check and disable some services and MTA services.
For this you need:
- Check that the services are already running with the systemctl -t service command.
- Disable all unnecessary and prevent them from starting, for example, to install mail services, you will need to disable postfix with the commands systemctl stop postfix and systemctl disable postfix.
Then you need to download Apache and PHP, necessary for the full operation of our server.
So, for this:
- Install the Apache package with the yum -y install httpd command.
- We make changes to the configuration file (there you must specify the server address, name, signatures, etc.).
- Start Apache and enable the autorun function with the commands systemctl start httpd and systemctl enable httpd.
- Then add PHP using the yum -y install php php-mbstring php-near command.
- Reboot Apache with systemctl restart httpd.
Installing the MySql database management system
Before installing MySql in CentOS7, it is worthwhile to clarify that when using the standard Yum download manager the system downloads an alternative version of the program under the name MariaDB, so in the case of CentOS it is necessary to go bypass.
To install MySql you need:
- Download the MySQL client from the official utility repository with the wget command * a link to the file with the MySql client *.
- Then install it in the system with the commands sudo rpm -ivh * the full name of the rpm file with the required version of MySql * and sudo yum install mysql-server.
- Then, confirm the operation twice by typing Y on the command line.
Installing Zabbix Monitoring System
To install Zabbix in CentOS 7, you need to find the latest version of the client on the official developer site and then install it on the system.
To do this you need:
- Add the repository with the rpm command Uvh * a link to the rpm file with the current version of Zabbix *.
- Update the list of available software with the yum update command.
- Then install the Zabbix client into the system with the yum install zabbix-agent command.
- After that, it remains to verify the client version (you need a third one) and to answer all the queries affirmatively by typing Y on the command line.
Installing the Zimbra Mail Server
Before you install Zimbra in CentOS 7, you need to prepare a system for this.
So, you need to do the following:
- Correctly configure the file etc / hosts and hostname.
- Allow in iptables all Zimbra ports.
- Turn off SeLinux.
- Disable all MTA services.
- Update the operating system with the yum update -y command.
- Then you need to load the corresponding packages with the command yum install perl perl-core ntpl nmap sudo libidn gmp.
- Then - the Zimbra utility itself with the wget command * a link to the file with the Zimbra utility of the current version *.
- Unzip the file with tar and go to the appropriate directory with the cd command.
- Then you need to start the installation process using the command ./install.sh -platform-override.