The current Zabbix frontend requires PHP version 7.2 or higher. Unfortunately, RHEL/CentOS 7 only provides PHP 5.4 by default. This page describes the proposed method of installing Zabbix frontend on RHEL/CentOS 7.
See also: Updating to PHP 7.3
If you do a clean installation of Zabbix 5.0 using official packages from repo.zabbix.com, you may notice that frontend packages are missing when searching for Zabbix with yum.
zabbix-agent.x86_64 : Old Zabbix Agent
zabbix-get.x86_64 : Zabbix Get
zabbix-java-gateway.x86_64 : Zabbix java gateway
zabbix-js.x86_64 : Zabbix JS
zabbix-proxy-mysql.x86_64 : Zabbix proxy for MySQL or MariaDB database
zabbix-proxy-pgsql.x86_64 : Zabbix proxy for PostgreSQL database
zabbix-proxy-sqlite3.x86_64 : Zabbix proxy for SQLite3 database
zabbix-release.noarch : Zabbix repository configuration
zabbix-sender.x86_64 : Zabbix Sender
zabbix-server-mysql.x86_64 : Zabbix server for MySQL or MariaDB database
zabbix-server-pgsql.x86_64 : Zabbix server for PostgreSQL database
This is due to the fact that frontend packages were moved to a dedicated frontend
sub-repository.
However, they can still be installed, if PHP 7.2 dependencies are provided.
For your convenience, any direct dependency on PHP has been removed from the main zabbix-web
package. This gives more flexibility in choosing the way to resolve PHP 7.2 dependency.
It is recommended to use PHP packages from Red Hat Software Collections.
To enable them run:
On RHEL
On CentOS
On Oracle Linux
# yum install scl-utils
# yum install oraclelinux-release-el7
# /usr/bin/ol_yum_configure.sh
# yum-config-manager --enable software_collections
# yum-config-manager --enable ol7_latest ol7_optional_latest
At this point
Should return a list of new rh-php7* packages.
Next, edit /etc/yum.repos.d/zabbix.repo
file (if there is no such file, install zabbix-release first). Enable zabbix-frontend
repository.
Replace enabled=0
with enabled=1
.
At this stage searching for Zabbix
with yum
shall return zabbix-web
package together with four new packages. These are:
zabbix-nginx-conf-scl.noarch : Zabbix frontend configuration for Nginx (scl version)
zabbix-web-deps-scl.noarch : Convenience package for installing PHP dependencies of zabbix-web package from redhat software collections
zabbix-web-mysql-scl.noarch : Zabbix web frontend for MySQL (scl version)
zabbix-web-pgsql-scl.noarch : Zabbix web frontend for PostgreSQL (scl version)
Install either zabbix-web-mysql-scl
for MySQL or zabbix-web-pgsql-scl
package for PostgreSQL. Also install also zabbix-apache-conf-scl
or zabbix-nginx-conf-scl
package, depending on web server used.
In Zabbix 4.4 support for Nginx was added, but the web server was not available in the official RHEL/CentOS 7 repositories. Thus, it had to be provided by the user via third-party repositores, in particular epel
. With Zabbix 5.0, if you choose to use Red Hat Software Collections, there is no need to use any third-party repositories, since Nginx is available in SCL. Simply install zabbix-nginx-conf-scl
package.
zabbix-web-deps-scl
This package pulls common PHP dependenencies of Zabbix frontend from Red Hat Software Collections.
# repoquery --requires zabbix-web-deps-scl
rh-php72
rh-php72-php-bcmath
rh-php72-php-fpm
rh-php72-php-gd
rh-php72-php-ldap
rh-php72-php-mbstring
rh-php72-php-xml
It also contains php-fpm pool for Zabbix, since in this configuration frontend works through fastcgi with both Apache and Nginx.
Configuration file is located at /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
.
zabbix-web-mysql-scl
Meta package that pulls zabbix-web
package and MySQL module for PHP, together with common PHP dependencies.
zabbix-web-pgsql-scl
Meta package that pulls zabbix-web
package and PostgreSQL module for PHP, together with common PHP dependencies.
zabbix-apache-conf-scl
This package pulls apache and contains /etc/httpd/cond.d/zabbix.conf
file.
zabbix-nginx-conf-scl
This package pulls Nginx from Red Hat Software Collections.
It also contains Zabbix configuration file for Nginx server at /etc/opt/rh/rh-nginx116/nginx/conf.d/zabbix.conf
.
If for some reasons Red Hat Software Collections can not be used, these alternative methods are available:
PHP modules needed for Zabbix frontend are php-gd
, php-bcmath
, php-mbstring
, php-xml
, php-ldap
and php-json
.
Special care must be taken during upgrade to Zabbix 5.0 from previous versions.
Packages from Red Hat Software Collections are designed to avoid conflicts with files from the main repositories.
Every such package is installed into a separate environment dedicated to its group.
For example, packages from rh-php72-php* group have their configuration installed under /etc/opt/rh/rh-php72/
directory, logs are under /var/opt/rh/rh-php72/log/
directory, etc. Services provided by these packages have unusual names such as rh-php72-php-fpm
or rh-nginx116-nginx
.
Official Zabbix 5.0 frontend packages use php-fpm with both Apache and Nginx.
This section provides Apache-specific instructions for upgrading Zabbix frontend and server from version 4.0 or 4.4 to 5.0. For Nginx-specific instructions see Upgrade process with Nginx.
Instructions below are for installing Zabbix with MySQL support. Substitute 'mysql' in the commands with 'pgsql' to use PostgreSQL
It is assumed that both frontend and server run on the same box. If you have different setup, make adjustments accordingly.
Remove old frontend
Existing Zabbix frontend must be removed before starting an upgrade. Old configuration file will be moved to /etc/httpd/conf.d/zabbix.conf.rpmsave
by rpm.
Install SCL repository
On RHEL
run
On CentOS
run
On Oracle Linux
run
yum install scl-utils
yum install oraclelinux-release-el7
/usr/bin/ol_yum_configure.sh
yum-config-manager --enable software_collections
yum-config-manager --enable ol7_latest ol7_optional_latest
Install Zabbix 5.0 release package and enable zabbix-frontend repository
Install zabbix-release-5.0
package.
rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
yum clean all
Edit /etc/yum.repos.d/zabbix.repo
file. Replace enabled=0
with enabled=1
.
Install new frontend packages
Official Zabbix 5.0 frontend packages use php-fpm. Update timezone in /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
file.
Update remaining packages and restart Zabbix server
Restarting Zabbix server will upgrade the database. Make sure the database is backed up.
Update remaining services
Start and enable php-fpm service.
Restart Apache.
Follow upgrade procedure for apache, described above, but make some adjustments.
A few more steps have to be performed:
Make sure to stop and disable old Nginx and php-fpm before upgrading. To do this, run:
When editing zabbix.conf
file for php-fpm, add user nginx
to listen.acl_users
directive
Make sure zabbix-nginx-conf-scl
package is installed instead of zabbix-apache-conf-scl
package.
Edit /opt/rh/rh-nginx116/nginx/conf.d/zabbix.conf
file.
Configure listen
and server_name
directives.
Start and enable Nginx and php-fpm