部署环境
系统:RHEL6.4
PHP:5.5.38 PHP安装:http://kurol.blog.51cto.com/11433546/1927720
nginx:1.10.3 nginx安装:http://kurol.blog.51cto.com/11433546/1927570
mysql:5.1.66
检查依赖包是否安装
[[email protected] ~]# rpm -qa libcurl-devel libxml2-devel net-snmp-devel net-snmp-devel-5.5-44.el6.x86_64 libxml2-devel-2.7.6-8.el6_3.4.x86_64 libcurl-devel-7.19.7-35.el6.x86_64
若未安装,则yum -y install安装
如果没有yum源,可挂载系统镜像,到里面找安装包,
或者自己制作本地yum源,参考:http://kurol.blog.51cto.com/11433546/1927721
zabbix安装,zabbix包下载地址:http://www.zabbix.com/download
[[email protected] ~]# tar -zxvf zabbix-2.2.18.tar.gz [[email protected] ~]# cd zabbix-2.2.18 [[email protected] zabbix-2.2.18]# ./configure --prefix=/usr/local/zabbix-2.2.18/ \ --enable-server \ --enable-agent \ --with-mysql \ --with-net-snmp \ --with-libcurl \ --with-libxml2 \ --enable-proxy [[email protected] zabbix-2.2.18]# make install
创建zabbix用户,和zabbix组:
[[email protected] ~]# groupadd –r zabbix [[email protected] ~]# useradd -g zabbix –r zabbix [[email protected] ~]# groups zabbix zabbix : zabbix
创建zabbix数据库,授权
zabbix服务器与 proxy需要数据库,agent不需要。
proxy只需要导入一个sql 文件而server一共要导入3个sql文件。
创建数据库一定要指定编码utf8:
[[email protected] ~]# mysql -uroot –p
mysql> CREATE DATABASE zabbix DEFAULT CHARSET utf8; mysql> CREATE USER ‘zabbix‘@‘127.0.0.1‘ IDENTIFIED BY ‘zabbix‘; mysql> GRANT all privileges ON zabbix.* TO ‘zabbix‘@‘localhost‘ IDENTIFIED BY ‘zabbix‘; mysql> FLUSH PRIVILEGES; mysql> exit;
[[email protected] ~]# cd zabbix-2.2.18 [[email protected] ~]# mysql -uzabbix –pzabbix zabbix < database/mysql/schema.sql [[email protected] ~]# mysql -uzabbix –pzabbix zabbix < database/mysql/images.sql [[email protected] ~]# mysql -uzabbix –pzabbix zabbix < database/mysql/data.sql
配置zabbix配置文件:
[[email protected] ~]# mkdir /etc/zabbix [[email protected] ~]# cp /usr/local/zabbix-2.2.18/etc/zabbix_server.conf /etc/zabbix/ [[email protected] ~]# vim /etc/zabbix/zabbix_server.conf DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword= zabbix ListenPort=10051 DBPort=3306
启动zabbix:
[[email protected] ~]# /usr/local/zabbix-2.2.8/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf
将zabbix的前端网页拷贝到nginx的html根目录
[[email protected] ~]# mkdir /usr/local/nginx/html/zabbix [[email protected] ~]# cp –rf zabbix-2.2.18/frontends/php/* /usr/local/nginx/html/zabbix [[email protected] ~]# chown -R zabbix.zabbix /usr/local/nginx/html/zabbix
浏览器打开页面:
查看php的配置文件php.ini
[[email protected] ~]# vim /usr/local/php-5.5.0/etc/php.ini
将上面的默认值修改:
post_max_size = 32M max_execution_time = 600 max_input_time = 600 date.timezone = Asia/Shanghai
点击Retry再检测:
bcmath精确计算的扩展没有安装
bcmath安装参考:http://kurol.blog.51cto.com/11433546/1927787
安装完成后点击Retry重新检测,全部OK,继续下一步
修改nginx的权限
[[email protected] local]# chmod -R 777 /usr/local/nginx
默认账号密码为admin zabbix
本人还是学生,还在学习阶段,有问题或不必要的操作还希望大家指出,感激不尽!
时间: 2024-10-14 09:39:59