b修改/usr/local/apache/
修改php.ini 文件
[[email protected] zabbix-3.2.7]# groupadd zabbix
[[email protected] zabbix-3.2.7]# useradd -g zabbix zabbix
yum安装 net-snmp,net-snmp-devel,mysql(mariadb),mysql-devel(mariadb-devel),curl,curl-devel
进入zabbix安装目录
./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2
make
make install
systemctl start mariadb
mysql create database zabbix character set utf8 collate utf8_bin; grant all privileges on zabbix.* to [email protected] identified by ‘123456‘; --------------------- 如果有如下报错 # MariaDB [(none)]> grant all on zabbix.* to [email protected] identified by ‘123456‘; #ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your #MariaDB server version for the right syntax to use near ‘‘123456‘‘ at line 1 修改‘’为英文状态 ---------------------- flush privileges; exit;
mkdir -p /usr/local/apache/htdocs/zabbix
[[email protected] zabbix-3.2.7]# cp -ra frontends/php/* /usr/local/apache/htdocs/zabbix
进入数据库文件目录,将相关数据导入数据库
[[email protected] mysql]# pwd /usr/src/zabbix-3.2.7/database/mysql [email protected] mysql]# mysql -uzabbix -p123456 zabbix < schema.sql [[email protected] mysql]# mysql -uzabbix -p123456 zabbix < images.sql [[email protected] mysql]# mysql -uzabbix -p123456 zabbix < data.sql
chown zabbix:zabbix /usr/local/apache/htdocs/zabbix
cp /usr/local/zabbix/sbin/zabbix_server /etc/init.d/
编辑/usr/local/zabbix/etc/zabbix_server.conf
修改DBHost=localhost DBName=zabbix DBUser=zabbix DBPssword=123456
报错:PHP bcmath extension missing (PHP configuration parameter --enable-bcmath).
进入php安装目录 /usr/src/php-7.1.7/ext/bcmath 执行/usr/src/php-7.1.7/ext/bcmath [[email protected] bcmath]# ./configure --with-php-config=/usr/local/php7/bin/php-config [[email protected] bcmath]# make & make install Installing shared extensions: /usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/
[[email protected] bcmath]# cd /usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/
[[email protected] php7]# cp /usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/bcmath.so /usr/local/php7/include/php/ext(这是默认路径,php.ini中可定义)
修改php.ini ,最后一行加
extension=bcmath.so
重启httpd zabbix服务