Step-by-Step Guide to Installing and Configuring Zabbix on CentOS 7
This tutorial walks you through disabling SELinux and the firewall, adding Zabbix and EPEL repositories, installing Zabbix server, web, and database components, configuring files, securing MariaDB, starting services, and completing the web‑based setup to get a fully functional monitoring system.
Zabbix Introduction
Zabbix is an open‑source, web‑based enterprise solution for distributed system and network monitoring, providing real‑time alerts and flexible notification mechanisms to help administrators quickly locate and resolve issues.
Zabbix Software Components
zabbix-server: monitoring server zabbix-agent: monitoring client zabbix-web: web interface service php: handles dynamic requests mysql: stores monitoring data zabbix: collects agent information and forwards it to the server
1. Disable Firewall and SELinux
setenforce 0</code>
<code>sed -ri '/^SELINUX=/cSELINUX=disabled' /etc/sysconfig/selinux</code>
<code>systemctl stop firewalld ; systemctl disable firewalld2. Add Zabbix and EPEL Repositories
rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm</code>
<code>wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo3. Install Zabbix and Related Service Packages
wget https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/{zabbix-server-mysql-4.0.20-1.el7.x86_64.rpm,zabbix-web-4.0.22-1.el7.noarch.rpm}</code>
<code>yum install -y httpd php zabbix-server-mysql-4.0.20-1.el7.x86_64.rpm zabbix-web-mysql</code>
<code>yum install -y mariadb-server4. Modify Zabbix Configuration Files
sed -ri.bak '/# DBPassword=/cDBPassword=zabbix' /etc/zabbix/zabbix_server.conf</code>
<code>sed -ri.bak 's/ #(.*)date.timezone.*/\1date.timezone Asia\/Shanghai/' /etc/httpd/conf.d/zabbix.conf5. Configure the Database Service
systemctl start mariadb</code>
<code>mysql_secure_installation</code>
<code>mysql -uroot -p</code>
<code>create database zabbix character set utf8 collate utf8_bin;</code>
<code>grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';</code>
<code>zcat /usr/share/doc/zabbix-server-mysql-4.0.20/create.sql.gz | mysql -uzabbix -pzabbix zabbix6. Start Zabbix and Related Services
systemctl start zabbix-server.service httpd mariadb.service</code>
<code>systemctl enable zabbix-server.service httpd mariadb.service7. Access Zabbix Web Interface for Initialization
Open http://172.16.210.56/zabbix/setup.php and follow the wizard: check PHP requirements, enter the database credentials, set host, port, and monitoring page name, then finish the installation.
8. Change Zabbix Interface Language to Chinese
Click the user icon at the top‑right, select “Chinese”, and click “Update”.
Original source: https://www.jianshu.com/p/7d798423ec58 Author: 南南宫问天
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
