赞
踩
yum -y update
yum install -y libevent-devel
yum install -y net-snmp-devel
yum install -y mysql-devel
yum install -y centos-release-scl
yum install -y devtoolset-11-gcc*
scl enable devtoolset-11 bash
下载zabbix源码包
wget https://cdn.zabbix.com/zabbix/sources/stable/6.4/zabbix-6.4.0.tar.gz
解压zabbix源码包
tar -zxvf zabbix-6.4.0.tar.gz
进入zabbix源码目录
cd zabbix-6.4.0
./configure --prefix=/usr/local/zabbix/ --enable-server --enable-agent --with-net-snmp --with-mysql
make install
rm -rf /var/run/yum.pid
rpm -qa | grep mariadb
yum remove -y `rpm -aq mariadb*`
rpm -Uvh https://repo.mysql.com//mysql80-community-release-el7-11.noarch.rpm
本次安装的就是8.0
默认为MySQL8.0仓库 如果启用mysql5.7仓库 需要禁用mysql8.0仓库
sed -i 5s/0/1/ /etc/yum.repos.d/mysql-community.repo
sed -i 14s/1/0/ /etc/yum.repos.d/mysql-community.repo
yum update -y
yum install -y mysql-community-server
systemctl restart mysqld
systemctl enable mysqld
mysqlpassword=$(grep 'A temporary password' /var/log/mysqld.log | awk '{print $NF}')
echo $mysqlpassword
mysql -u root -p
alter user 'root'@'localhost' identified by 'C8N_c8n123456.';
flush privileges;
create database zabbix character set utf8 collate utf8_bin;
create user 'zabbix'@'localhost' identified by 'Zabbix@123.';
grant all privileges on zabbix.* to zabbix@localhost;
set global log_bin_trust_function_creators = 0;
ALTER USER 'zabbix'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Zabbix@123.';
quit
mysql -uzabbix -p'Zabbix@123.' zabbix < /root/zabbix-6.4.0/database/mysql/schema.sql
mysql -uzabbix -p'Zabbix@123.' zabbix < /root/zabbix-6.4.0/database/mysql/images.sql
mysql -uzabbix -p'Zabbix@123.' zabbix < /root/zabbix-6.4.0/database/mysql/data.sql
sed -i '123s/# DBPassword=/DBPassword=Zabbix@123./' /usr/local/zabbix/etc/zabbix_server.conf
yum install -y mysql-community-libs-compat
groupadd zabbix
useradd -g zabbix -M -s /sbin/nologin zabbix
cd /usr/local/zabbix/sbin/
./zabbix_server
./zabbix_agentd
yum -y install yum-utils
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum-config-manager --disable 'remi-php*'
yum-config-manager --enable remi-php80
yum install -y php php-bcmath php-cli php-common php-devel php-fpm php-gd php-intl php-ldap php-mbstring php-mysqlnd php-odbc php-pdo php-pear php-pecl-xmlrpc php-pecl-zip php-process php-snmp php-soap php-sodium php-xml
sed -i '703s/post_max_size = 8/post_max_size = 16/' /etc/php.ini
sed -i '409s/max_execution_time = 30/max_execution_time = 300/' /etc/php.ini
sed -i '419s/max_input_time = 60/max_input_time = 300/' /etc/php.ini
yum -y install httpd
cd /opt
wget https://cdn.zabbix.com/zabbix/sources/stable/6.4/zabbix-6.4.0.tar.gz
tar -zxvf zabbix-6.4.0.tar.gz
cp -r zabbix-6.4.0/ui/* /var/www/html/
yum -y install wqy-microhei-fonts
mv /var/www/html/assets/fonts/DejaVuSans.ttf /var/www/html/assets/fonts/DejaVuSans.ttf_bak
cp /usr/share/fonts/wqy-microhei/wqy-microhei.ttc /var/www/html/assets/fonts/DejaVuSans.ttf
systemctl restart httpd
systemctl enable httpd
通过IP地址直接访问进行交互式配置
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。