cenntos7 部署zabbix 4.2.3

1.安裝mysql8.0
rpm -ivh https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
rpm -ivh mysql-server
mysqld --initialize
systemctl start mysqld
mysqladmin -uroot -p

2.安裝appache、php
yum -y install php httpd php-bcmath php-xml php-mbstring php-gd php-ldap php-mysql

3.安裝zabbix server
#創建用戶組
groupadd zabbix
useradd -g zabbix zabbix

#源碼安裝
yum -y install unixODBC-devel mysql-devel net-snmp-devel libxml2-devel libcurl-devel libevent-devel libssh2-devel ldap-devel OpenIPMI-devel
wget https://excellmedia.dl.sourceforge.net/project/zabbix/ZABBIX Latest Stable/4.2.3/zabbix-4.2.3.tar.gz
tar -zxvf zabbix-4.2.3.tar.gz
cd zabbix-4.2.3
./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2
make install

#創建啓動項
cp zabbix-4.0.3/misc/init.d/fedora/core5/* /etc/init.d/
chkconfig --add zabbix_server zabbix_agentd

#創建數據庫
create database zabbix character set utf8 collate utf8_bin;

#創建用戶
create user [email protected] identified with mysql_native_password by ‘[email protected]’;
mysql -uroot [email protected] -D mysql -e “show columns from user” | awk ‘{print $1}’ | grep priv | while read line;do mysql -uroot [email protected] -D mysql -e “update user set $line=‘y’ where user=‘zabbix’”;done

grant all privileges on zabbix.* to [email protected]//mysql8.0不能使用賦權的方式創建用戶

shell> cd database/mysql
shell> mysql -uzabbix -p zabbix < schema.sql

stop here if you are creating database for Zabbix proxy

shell> mysql -uzabbix -p zabbix < images.sql
shell> mysql -uzabbix -p zabbix < data.sql

#修改zabbix_server配置
cd /usr/local/etc/
vi zabbix_server.conf

DBUser=zabbix
DBName=zabbix
DBPassword=

#修改php配置信息
vi /etc/php.ini
memory_limit = 128M
post_max_size = 16M
upload_max_filesize = 2M
max_execution_time = 300
max_input_time = 300
session.auto_start = 0
mbstring.func_overload = 0
always_populate_raw_post_data = -1 #只適用於 PHP 5.6.0 或更高的版本

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章