前期准备:
安装mysql5.6和php5.6(本文后面有讲如何安装php),想知道怎么装mysql的请出门左转(在centos7安装mysql6)php
wget https://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.4.6/zabbix-3.4.6.tar.gz
tar -zxvf zabbix-3.4.6.tar.gz cd zabbix-3.4.6
groupadd zabbix useradd -g zabbix zabbix
./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2
make install
### Option: DBHost 数据库地址 # Database host name. # If set to localhost, socket is used for MySQL. # If set to empty string, socket is used for PostgreSQL. # # Mandatory: no # Default: DBHost=localhost ### Option: DBName 数据库名称 # Database name. # For SQLite3 path to database file must be provided. DBUser and DBPassword are ignored. # # Mandatory: yes # Default: # DBName= DBName=zabbix ### Option: DBUser 数据库帐号 # Database user. Ignored for SQLite. # # Mandatory: no # Default: # DBUser= DBUser=zabbix ### Option: DBPassword 数据库密码 # Database password. Ignored for SQLite. # Comment this line if no password is used. # # Mandatory: no # Default: # DBPassword= DBPassword=zabbix
shell> mysql -uroot -p<password> mysql> create database zabbix character set utf8 collate utf8_bin; mysql> grant all privileges on zabbix.* to zabbix@localhost identified by '<password>'; mysql> quit; shell> cd database/mysql shell> mysql -uzabbix -p<password> zabbix < schema.sql # stop here if you are creating database for Zabbix proxy shell> mysql -uzabbix -p<password> zabbix < images.sql shell> mysql -uzabbix -p<password> zabbix < data.sql
zabbix_server
mkdir /var/www/html/zabbix
cd frontends/php cp -a . /var/www/html/zabbix
http://192.168.31.190/zabbix
Minimum required size of PHP post is 16M (configuration option "post_max_size"). Minimum required limit on execution time of PHP scripts is 300 (configuration option "max_execution_time"). Minimum required limit on input parse time for PHP scripts is 300 (configuration option "max_input_time"). Time zone for PHP is not set (configuration parameter "date.timezone"). PHP bcmath extension missing (PHP configuration parameter --enable-bcmath). PHP option "always_populate_raw_post_data" must be set to "-1"
date.timezone = Asia/Shanghai extension=bcmath.so
systemctl restart httpd
安装apache和php,能够参考《centos6.7下搭配apache php mysql环境》,注意那篇文章安装的多是php5.3,若是是5.3会报错:html
syntax error, unexpected '[' in /var/www/html/zabbix/index.php on line 32
官网说https://support.zabbix.com/br...
须要php5.4以上。因而卸载了php5.3,从新安装5.6mysql
yum install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mcrypt.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64 php56w-xml.x86_64 php56w-bcmath.x86_64
若是镜像没有,需先安装镜像linux
Centos 5.X rpm -Uvh http://mirror.webtatic.com/yum/el5/latest.rpm CentOs 6.x rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm CentOs 7.X rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum install mysql-devel -y
yum install libxml2-devel -y
yum install net-snmp-devel -y
yum install libevent-devel -y
yum install curl-devel -y
6.1安装 autoconf-2.63-5.1.el6.noarch.rpm和 automake-1.11.1-4.el6.noarch.rpm
6.2 运行
autoreconf -ivf