前期準備:
安裝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