CentOS 7.2 installation Zabbix3.X


First, CentOS installation 7


Turn off selinux #setenforce 0 temporarily closed


Need to turn off selinux, be sure to close the open SELinux may cause a series ofproblems, and even the discovery functionality of ZABBIX in normal use
# sed -i “s/SELINUX=enforcing/SELINUX=disabled/g” /etc/selinux/config
Confirm change success
# grep SELINUX /etc/selinux/config
Then restart the system
# reboot
Turn off the firewall


Systemctl start firewalld.service# start the firewall
Systemctl stop firewalld.service# stop firewall
Systemctl disable firewalld.Service# prohibit firewall boot
YUM installation source: CD/etc/yum.repos.d/



yum clean all


yum makecache


Second, install LAMP
1, the installation of MySQL


Starting from the latest version of the Linux system, the default is Mariadb, not MySQL!
Repos that come using the system installation is simple:
# yum install -y mariadb mariadb-server
Start the mariadb
# systemctl start mariadb
Service management before the command can also be used
# service mariadb start
Set post launch
# systemctl enable mariadb
Security initialized, set the root password
# mysql_secure_installation
Test login
# MySQL-uroot-p123456//the password 123456
2. install the Apache software


# yum -y install httpd
# systemctl start httpd.service
# systemctl enable httpd.service
# Systemctl status httpd.service//check status


Enabled indicates that the httpd service is set to boot, active (running) in the httpd service is running.
3. install PHP


# yum -y install php
Installation PHP-MySQL
PHP-MySQL is a PHP program that uses MySQL database module. To install thismodule, use the command:


# yum -y install php-mysql


# Systemctl restart httpd//restart the httpd service


After the installation is complete, PHP will generate a configuration file/etc/httpd/conf.d/PHP.conf because the configuration file in/etc/httpd/conf.d directory, so it can be read by Apache. PHP also generates the configuration file/etc/httpd/conf.modules.d/10-PHP.conf, the configuration files will be read by Apache, it‘s setting allows Apache to load the PHP module. However, PHP configuration files of the software itself is in fact/etc/php.ini.
You can test: to test Apache would normally call the PHP, create a phpinfo.php filein the/var/www/html directory, as shown below:


<?Php phpinfo ();? >//<?php? > is the syntax of the PHP program, phpinfo () is a PHP program to provide a library, the library can display information about your Webserver.
Visit http://IP/phpinfo.php



Third, install Zabbix


Installation package download address: http://www.ZABBIX.com/download.php



2. the import source:


3. install ZABBIX package


yum -y install zabbix-server-mysql zabbix-web-mysql
4. this machine is installed on the client


yum -y install zabbix-agent
5. initialize database


mysql> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)


mysql> grant all privileges on zabbix.* to zabbix@localhost identified by ‘zabbix’; Password ZABBIX


Query OK, 0 rows affected (0.00 sec)


mysql> quit
Access to this directory


#cd /usr/share/doc/zabbix-server-mysql-3.2.1
Run the command


# zcat create.sql.gz | MySQL-uroot-p ZABBIX//new ZABBIX password ZABBIX database
6. ZABBIX Server service is started


# vim /etc/zabbix/zabbix_server.conf
I modified the configuration file is actually DBHost and DBPassword, remove the #in front of it.
ZABBIX service is started, set the power-on self start


#systemctl start zabbix-server
#systemctl enable zabbix-server
7. editing PHP combined with configuration of ZABBIX front-end


php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value always_populate_raw_post_data -1
Php_value date.TimeZone Asia/Shanghai//remove the # to mainly in Shanghai
Adjust the time synchronization: install ntpdate, yum-y install ntpdate




Starting the Apache service, set the power-on self start


#systemctl start httpd
#systemctl enable httpd
8. landing ZABBIX




The default user name/password: Admin/zabbix


Text under the picture solution:




Win+R open run, type fonts, enter into the Windows fonts directory, locate Microsoft yaheiregular fonts, copy modify the file name to msyh.ttf, and then uploaded to/usr/share/ZABBIX/fonts


After a successful upload, edit



Modify the ‘graphfont’ to msyh
Modified define (‘ZBX_GRAPH_FONT_NAME’, ‘msyh’); font file name


Can also execute the command:


View the font configuration # grep FONT_NAME/usr/share/zabbix/include/defines.inc.php-n
45:define(‘ZBX_GRAPH_FONT_NAME’, ‘graphfont’); font file name
93:define(‘ZBX_FONT_NAME’, ‘graphfont’);
Confirm whether the font name can be replaced
45:define(‘ZBX_GRAPH_FONT_NAME’, ‘graphfont’); font file name
93:define(‘ZBX_FONT_NAME’, ‘graphfont’);
Perform a quick replace
Confirm replace succeeded
45:define(‘ZBX_GRAPH_FONT_NAME’, ‘msyh’); font file name
93:define(‘ZBX_FONT_NAME’, ‘msyh’);