安装Centos6.9,配置IP地址:

vi /etc/sysconfig/network-scripts/ifcfg-eth0 #修改网卡IP地址
service network restart #重启网络服务
yum update #命令更新系统
yum install vim #安装vim

yum install -y wget && wget -O install.sh http://download.bt.cn/install/install.sh && sh install.sh #安装宝塔面板5.9,用于配置web环境

安装完毕,浏览器登录设置的内网地址登录宝塔管理页面


分別使用groupadd zabbix、useradd zabbix -g zabbix -s /sbin/nologin命令新建zabbix用戶组和zabbix用戶
yum -y install epel-release #使用命令安裝epel源。
yum -y install net-snmp-devel fping #使用命令安裝编译Zabbix需要的各种依赖和组件。


https://www.zabbix.com/cn/download_agents 下载zabbix安装包

上传zabbix安装包到网站目录解压并粘贴出来,我这里的网站路径是/www/wwwroot/192.168.101.16

cd /www/wwwroot/192.168.101.16 #进入网站路径
./configure –enable-server –enable-agent –with-mysql –enable-ipv6 –with-net-snmp –with-libcurl –with-libxml2 #使用命令对zabbix进行编译

make install #使用命令进行安装




修改PHP
max_input_time值修改为300

vim /usr/local/etc/zabbix_server.conf #对zabbix服务器修改数据库参数 :wq 保存退出

service iptables stop 、
chkconfig iptables off #关闭防火墙

zabbix_server、zabbix_agentd #启动zabbix服务端、客户端

cp -r /www/wwwroot/192.168.101.16/zabbix-4.0.5/frontends/php/* /www/wwwroot/192.168.101.16/ #复制文件







phpize #输入命令
./configure –with-php-config=/www/server/php/70/bin/php-config #输入命令


cd回到根目录, yum install openldap openldap-devel -y 安装依赖

cd /root/ldap/进入路径再次执行
./configure –with-php-config=/www/server/php/70/bin/php-config 出现configure: error: Cannot find ldap libraries in /usr/lib. 错误

cd到根目录执行 cp -frp /usr/lib64/libldap* /usr/lib/ 命令

再次进入模块路径执行
./configure –with-php-config=/www/server/php/70/bin/php-config

make &make install #安装

找到php中的php.ini文件末尾添加extension=ldap.so







配置完成!

