Prerequisites and setting up the environment

Of course, being a Zabbix web frontend, it will require a platform to run on—a web server with a PHP environment. We will need the following installed:

  • A web server that is supported by PHP; Apache is the most common choice
  • PHP version 5.4.0 or higher
The following instructions apply when installing from source. Installing from packages usually installs the Zabbix frontend as well. On CentOS make sure you have Apache enabled and started. 

In the next code block, we will show you how to install the webserver on CentOS and Debian:

On CentOS
# yum install httpd php php-ldap php-mysql
# systemctl enable httpd
# systemct start httpd

On Debian/Ubuntu
# apt install apache2 php php7.2-cli php7.2-mysql php7.2-common php7.2-curl php7.2-json php7.2-cgi libapache2-mod-php7.2 php7.2 php7.2-ldap

It is easiest to install these from the distribution packages as it will take care of all of the dependencies we need. Just make sure you install the correct PHP connector for your databasein our case, this is php-mysql. If you would like to make a connection to your AD/LDAP, you also need to make sure that php-ldap is installed.

Some distributions split out the core PHP modules. These might include ctype, net-socket, libxml, and others.

Once you have all of these installed, it's time to set up the frontend. Again, there's a choice of using packages or installing from source. If you decided to go with the packages, you should have the frontend installed already and should be able to proceed with the configuration wizard section explained next. If you went with the source installation, it's just a simple copying of some files.

First, you have to decide where the frontend code has to go. Most distributions that package web servers use /srv/www/htdocs or /var/www. If you compiled the Apache web server from the source, it would be /usr/local/apache2/htdocs (unless you manually changed the prefix or installed an older Apache version). We will place the frontend in a simple subdirectory, zabbix.

Assuming you have Apache distribution packages installed with the web root directory at /srv/www/htdocs, placing the frontend where it is needed is as simple as executing the following as the root user:

# cp -r frontends/php /srv/www/htdocs/zabbix

The last thing we need to do is open our firewall so that our browser can connect on the web server port of our server:

CentOS/Red Hat
# firewall-cmd --add-service=http --permanent
# firewall-cmd --reload

Debian / Ubuntu
(standard there is no firewall installed you could use iptables or ufw or similar solution)
# apt install firewalld
Zabbix provides out of the box a configuration for HTTP. This is not really best practice and it's advised in production to configure Zabbix properly with HTTPS.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.131.178