How To Install Zabbix 5 On CentOS 8

Zabbix 5 has a lot of GUI imrovment and other new features, notice the installation on CentOS 8 is a little different. lets start .

If you are a fan of SELinux you can set it to permissive mode :

setenforce 0 && sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/selinux/config

To disable just edit with #nano /etc/selinux/config

And set : SELINUX=disabled

Next install libssh2.so.1 which is needed by zabbix 5

#dnf -y install http://mirror.centos.org/centos/8.0.1905/AppStream/x86_64/os/Packages/libssh2-1.8.0-8.module_el8.0.0+189+f9babebb.1.x86_64.rpm

Then install zabbix

#rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm
#dnf clean all
#dnf -y install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-agent

Now we have to add mysql server = mariaDB

#dnf -y install mariadb-server && systemctl start mariadb && systemctl enable mariadb

configure the mysql server :

#mysql_secure_installation

Create User & DB (notice the charset = utf8 which is required by zabbix 5)

#mysql -u root -p
create database zabbix_db character set utf8 collate utf8_bin;
grant all privileges on zabbix_db.* to zabbix_user@localhost identified by 'zabbix' ;
flush privileges;
show create database zabbix_db;     ->to make sure db is created O.K
exit
Temporary disable strict mode (ZBX-16465) to avoid MySQL error “ERROR 1118 (42000) at line 1284: Row size too large (> 8126)” :
#mysql -uroot -p'your_password you set for mysql' zabbix_db -e "set global innodb_strict_mode='OFF';"
build database :
#zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix_user -p'zabbix' zabbix_db
re-enable stric mode:
#mysql -uroot -p'your_password you set for mysql' zabbix_db -e "set global innodb_strict_mode='ON';"

configure Zabbix for the database we have prepared for it :

#nano /etc/zabbix/zabbix_server.conf
DBname=zabbix_db
DBuser=zabbix_user
DBPassword=zabbix

Start zabbix

#systemctl restart zabbix-server zabbix-agent 
#systemctl enable zabbix-server zabbix-agent

Add firewall rules

#firewall-cmd --add-service={http,https} --permanent
#firewall-cmd --add-port={10051/tcp,10050/tcp} --permanent
#firewall-cmd --reload

Now lets start configure the web frontend

#nano /etc/php-fpm.d/zabbix.conf
php_value date.timezone Asia/Jerusalem

restart the website service :

#systemctl restart httpd php-fpm
#systemctl enable httpd php-fpm

Thats it ! Now open a browser and surf to

http://your_zabbix_server_IP/zabbix
Enter this variables 
Database name : zabbix_db
user : zabbix_user
Password : zabbix

Now you are done! enjoy


Good Luck

Leave a Reply

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