CentOS7用tar.gz的方式安装zabbix-3.4.12

软件:VMware 12

系统:CentOS 7

安装zabbix版本:zabbix-3.4.12

1.下载zabbix,解压

[root@localhost ~]# cd /usr/src/

[root@localhost src]# wget https://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.4.12/zabbix-3.4.12.tar.gz

[root@localhost src]# tar -xf zabbix-3.4.12.tar.gz

2.安装依赖包

[root@localhost src]# yum -y install net-snmp-devel libevent-devel

3.创建zabbix用户和组

[root@localhost src]# groupadd -r zabbix
[root@localhost src]# useradd -r -g zabbix -M -s /sbin/nologin zabbix

4.配置zabbix数据库

[root@localhost src]# service mysqld start
[root@localhost src]# mysql -uroot -p123456
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix123!';
Query OK, 0 rows affected, 2 warnings (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

mysql>  quit
Bye
[root@localhost ~]# cd /usr/src/zabbix-3.4.12/database/mysql
[root@localhost mysql]# mysql -uzabbix -pzabbix123! zabbix < schema.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@localhost mysql]# mysql -uzabbix -pzabbix123! zabbix < images.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@localhost mysql]# mysql -uzabbix -pzabbix123! zabbix < data.sql
mysql: [Warning] Using a password on the command line interface can be insecure.

4.编译安装zabbix

[root@localhost ~]# cd /usr/src/zabbix-3.4.12\
[root@localhost zabbix-3.4.12]# ./configure --enable-server \
> --enable-agent \
> --with-mysql \
> --with-net-snmp \
> --with-libcurl \
> --with-libxml2
[root@localhost zabbix-3.4.12]# make install

5.修改/etc/php.ini的配置并重启php-fpm

[root@localhost zabbix-3.4.12]# cd /etc/
[root@localhost etc]# sed -ri 's/(post_max_size =).*/\1 16M/g' /etc/php.ini
[root@localhost etc]# sed -ri 's/(max_execution_time =).*/\1 300/g' /etc/php.ini
[root@localhost etc]# sed -i '/;date.timezone/a date.timezone = Asia/Shanghai' /etc/php.ini
[root@localhost etc]# service php-fpm restart

参考文档:https://blog.csdn.net/weixin_44437026/article/details/88066510

猜你喜欢

转载自www.cnblogs.com/hydd/p/12532744.html
今日推荐