1:安装nginx
复制 zabbix 包下的 zabbix-3.0.3/frontends/php 到nginx 执行的程序目录
2:安装php
php.ini:
max_execution_time = 300max_input_time = 300 post_max_size = 16M always_populate_raw_post_data = -1 date.timezone = Asia/Shanghai extension_dir = "/opt/app/php/lib/php/extensions/no-debug-non-zts-20131226/"extension=gd.so
3:安装mysql
4:安装zabbix
下载源码包:
创建用户:
groupadd zabbix useradd -g zabbix zabbix
解压:
$ tar -zxvf zabbix-3.0.0.tar.gz
查看编译帮助
./configure --help
根据自己需要选择:
编译前安装一些依赖:yum install net-snmp-devel OpenIPMI-devel
./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 --with-openipmi --prefix=/opt/app/zabbix
install:
make install
mysql 设置
# 创建数据库,用户
mysql> create database zabbix; mysql> grant all on zabbix.* to [email protected]‘localhost‘ identified by ‘zabbix‘
导入表(根据自己存储的数据库不同):
cd ~/zabbix-3.0.3/database/mysql/ mysql -uzabbix -p zabbix < schema.sql mysql -uzabbix -p zabbix < images.sql mysql -uzabbix -p zabbix < data.sql
将zabbix 加入自启动:
cp misc/init.d/fedora/core/zabbix_server /etc/init.d/ chmod +x /etc/init.d/zabbix_server
启动时报错:
ln -s /usr/local/webserver/mysql/lib/libperconaserverclient.so.18 /usr/lib64
启动时一个错误
PHP option "always_populate_raw_post_data" must be set to "-1"
PHP gd extension missing (PHP configuration parameter --with-gd).
PHP gd PNG image support missing.
PHP gd JPEG image support missing.
PHP gd FreeType support missing.
安装了
yum install libpng-devel
继续报错
到php 的ext/gd目录下
../../scripts/phpize ./configure --with-php-config=/opt/app/php/bin/php-config -with-jpeg-dir --with-freetype-dir make && make install
安装gd后继续报错
PHP gd JPEG image support missing.
PHP gd FreeType support missing.
百度一下大概意思 configure 编译的时候 找不到 libjpeg.so
默认路径不一样
做个软连接 :
ln -s /usr/lib64/libjpeg.so /usr/local/lib/libjpeg.so
php -r ‘print_r(gd_info());‘ 看到 已经支持了;
但是还需要重新编译一下gd库;
配置完毕 在程序目录下 /data/www/php/conf 生成 zabbix.conf.php 文件
默认登录信息 admin / zabbix