Installing and Configuring Zabbix 2.4.5 on Debian 8 and RHEL/CentOS 7
Step 4: Download, Compile and Install Zabbix Server
7. Now your system is ready for compiling and installing Zabbix server from sources. First, using the wget utility, grab the latest version of Zabbix archive ( 2.4.5 current version when writing the guide) by issuing the following command:
# wget http://sourceforge.net/projects/zabbix/files/ZABBIX\ Latest\ \Stable/2.4.5/zabbix-2.4.5.tar.gz
If you want to download and compile an older version, please visit Zabbix official Sourceforge repositories.
8. Next, decompress and extract zabbix archive, enter into the extracted directory and list its contents.
# tar xfz zabbix-2.4.5.tar.gz # cd zabbix-2.4.5.tar.gz/ # ls
9. While your placed into zabbix sources directory, get a list of compiling parameters for zabbix by running
./configure -h command.
Once you decided on your Zabbix server configuration, run
./configure command with the appropriate compiling parameters and wait for the compilation process to finish.
For this setup and for a standard Zabbix server compilation from sources use the following parameters as below:
# ./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2
10. Once the software has been configured, run the
make command in order to create the installable binaries (usually this step takes longer than configuring command to finish) and install Zabbix by issuing the
make install command with root privileges:
# make # make install
Step 5: Zabbix Post-Installation System Settings
11. On the next step you need to create an unprivileged system account that will run Zabbix daemon process. Issue the below commands to create zabbix group and system account:
# groupadd zabbix # useradd -g zabbix -d /usr/local/share/zabbix -s /bin/false zabbix
Step 6: Configure MariaDB Database for Zabbix
12. Next, enter Mariadb database command line and create a MySQL database for Zabbix server with a privileged user to manage the database by issuing the following commands:
mysql -u root -p MariaDB> create database zabbix; MariaDB> grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by 'your_password'; MariaDB> flush privileges; MariaDB> exit
If your zabbix server runs on a different system than MariaDB server, add the following line to MariaDB server in order for zabbix user to access the database remotely (you can replace % with the IP Address of the zabbix host):
MariaDB> grant all privileges on zabbix.* to 'zabbix'@'%' identified by 'your_password';
13. On the next step enter zabbix extracted source directory (in case you left the location meantime), list the available MySQL tables and import all of them into the newly created zabbix database by running the following commands:
# cd zabbix-2.4.5/ # ls database/mysql/ # mysql -u zabbix -p zabbix < database/mysql/schema.sql # mysql -u zabbix -p zabbix < database/mysql/images.sql # mysql -u zabbix -p zabbix < database/mysql/data.sql
Step 7: Configure Apache Webserver for Zabbix
14. After importing MySQL tables, copy all the sources PHP frontend configuration files into Apache webserver document root by issuing the below command. Also, make sure that you previously delete the default Apache index.html file.
# rm /var/www/html/index.html15. # cp -rf frontends/php/* /var/www/html/
15. Next, add zabbix system user to Apache system group www-data, enable SSL Apache module and host in order to run Zabbix web interface securely and restart Apache daemon to apply changes.
On Debian 8 System
# usermod -aG www-data zabbix # a2enmod ssl # a2ensite default-ssl # systemctl restart apache2.service
On RHEL/CentOS 7 System
# usermod -aG apache zabbix # systemctl restart httpd.service