所有問題解決以後,安裝成功
php -v(查看php版本)
PHP 5.6.27 (cli) (built: Oct 15 2016 21:31:59)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
在數據庫中設定配置zabbix用戶、密碼、權限
# mysql -u root -p
Enter password:
mysql>create database zabbix character set utf8;
mysql>insert into mysql.user(Host,User,Password) values('localhost','zabbix',password('zabbix'));
mysql>grant all on zabbix.* to 'zabbix'@'127.0.0.1' identified by 'zabbix' with grant option;
mysql>flush privileges;
若出現下列錯誤:
[root@localhost ~]#/etc/init.d/mysqld restart
Stopping mysqld: [ OK ]
Another MySQL daemon already running with the same unix socket.
Starting mysqld: [FAILED]
原因多个Mysql进程使用了同一个socket
#cd /var/lib/mysql/mysql.sock直接把mysql.sock文件改名即可
然后就可以启动mysql了
將下載好的zabbix-3.0.2進行解壓及安裝
# tar -zxvf zabbix-3.0.2.tar.gz
# cd zabbix-3.0.2
# ./configure --with-mysql=/usr/bin/mysql_config --with-net-snmp
--with-libcurl --enable-server --enable-agent --enable-proxy
--prefix=/usr/local/zabbix
--prefix----> 指定zabbix安装目录
--enable-server----> 支持zabbix服务器
--enable-agent----> 支持zabbix代理
--enable-proxy----> 支持zabbix代理服务器
--with-libcurl----> 使用curl包
--with-net-snmp----> 使用net-snmp软件包,选择性地指定路径NET-SNMP配置
--with-mysql=/usr/bin/mysql_config 使用MySQL客户端库可以选择指定路径mysql_config
注:如出现configure: error: MySQL library not found错误,是因为缺少mariadb-devel该软件包
,yum install mariadb-devel进行安装
# make
# make install
# mysql -uzabbix -pzabbix
# show databases;
mysql > use zabbix;
mysql > source /usr/local/zabbix-3.0.2/database/mysql/schema.sql
mysql > source /usr/local/zabbix-3.0.2/database/mysql/data.sql
mysql > source /usr/local/zabbix-3.0.2/database/mysql/images.sql
注:上述行為是先將zabbix的數據庫表結構導入到指定的空數據庫中
調整后進行重啟apache服務就可進入下面的安裝步驟
# service httpd restart
如果在此期間出現下列情況
httpd:Could not reliably determine the server's fully qualified domain name
解決辦法:修改apache配置文件
vi /etc/httpd/conf/httpd.conf
# ServerName www.example.com:80
改成或在其後加上
ServerName localhost:80
重啟apache服務
service httpd restart
最后一步可能會報錯:
Configuration file "/var/www/html/zabbix/conf/zabbix.conf.php" created: Fail
可以下載,也可以利用現有資源進行配置即可
# cd /var/www/html/zabbix/conf
# cp zabbix.conf.php.example zabbix.conf.php
# vi zabbix.conf.php