Setup Zabbix Centos7 step by step
Install apache marialDB php
Apache
sudo yum install httpdsudo systemctl start httpd.service
If you have nginx installed. need to stop it first (systemctl stop nginx)
MarialDB
sudo yum install mariadb-server mariadbsudo systemctl start mariadbsudo mysql_secure_installation
Php
sudo yum install php php-mysql
test installation
sudo vi /var/www/html/info.php
add line
<?php phpinfo(); ?>
curl http://localhost/info.php
Install Zabbix
sudo rpm -Uvh https://repo.zabbix.com/zabbix/4.2/rhel/7/x86_64/zabbix-release-4.2-1.el7.noarch.rpmsudo yum clean allsudo yum install zabbix-server-mysql zabbix-web-mysqlsudo yum install zabbix-agent
config zabbix database
mysql -u rootcreate database zabbix character set utf8 collate utf8_bin;grant all privileges on zabbix.* to zabbix@localhost identified by ‘secret’;flush privileges;quit;
Import zabbix database
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
update mysql config in conf
sudo vi /etc/zabbix/zabbix_server.confDBHost=localhostDBName=zabbixDBPassword=secret
update timezone
sudo vi /etc/httpd/conf.d/zabbix.conf# php_value date.timezone {YOUR_TIMEZONE}
timezone list can be find here https://www.php.net/manual/en/timezones.asia.php
Restart services
sudo systemctl restart httpdsudo systemctl start zabbix-serversudo systemctl start zabbix-agentsudo systemctl enable zabbix-serversudo systemctl enable zabbix-agentsudo systemctl status zabbix-server

sudo systemctl status zabbix-agent

open http://your_ip/zabbix/setup.php

make sure all status are ‘ok’

key in your database password




credential for first login : Admin/zabbix


Done
Fix error — “Zabbix server is not running”
#1 vi /etc/zabbix/web/zabbix.conf.php
Make sure mysql server/username/password/hostname is correct
#2 vi /etc/zabbix/zabbix_server.conf
make sure dbhost dbname dbpassword is correct
#3 Important: If SELinux is running in enforcing mode, you need to put it into permissive mode
sudo setenforce 0