一、基础环境
1.1 查看操作系统版本
cat /etc/redhat-release
1.2 关闭防火墙
cat /etc/sysconfig/selinux(selinux修改为disable)
systemctl status firewall(systemctl stop firewalld && systemctl disable firewalld )
二、安装mysql数据库
2.1 下载和配置mysql安装源
wget https://dev.mysql.com/get/mysql80-community-release-el7-5.noarch.rpm
yum -y install mysql80-community-release-el7-5.noarch.rpm
2.2 安装软件依赖包
yum -y install gcc-c++ mysql-devel net-snmp-devel libevent-devel
2.3 下载zabbix和mysql安装包
wget https://cdn.zabbix.com/zabbix/sources/stable/6.0/zabbix-6.0.1.tar.gz
wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.28-1.el7.x86_64.rpm-bundle.tar
2.4 安装mysql
创建mysql安装目录
mkdir /usr/local/mysql
解压mysql安装包
tar xf mysql-8.0.28-1.el7.x86_64.rpm-bundle.tar -C /usr/local/mysql
rpm方式安装mysql
rpm -ivh mysql-community-* --force --nodeps
2.5 启动mysql服务
systemctl start mysqld
systemctl enable mysqld
systemctl status mysqld.service
2.6 查看mysql服务是否启动
2.7 mysql密码和服务设置
密码为y19fhpkdT6(k
密码检查等级,0/LOW、1/MEDIUM、2/STRONG
set global validate_password.policy=0;
密码的最短长度
set global validate_password.length=6;
密码至少要包含的小写字母个数和大写字母个数
set global validate_password.mixed_case_count=0;
设置密码
mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Qwer@123';
2.8 配置zabbix库
创建zabbix库
create database zabbix character set utf8 collate utf8_bin;
创建zabbix用户
create user zabbix@localhost identified by 'Qwer@123';
授权
grant all privileges on zabbix.* to zabbix@localhost;
三、安装zabbix
3.1 安装zabbix
创建zabbix目录
mkdir /usr/local/zabbix
解压
tar -zxvf zabbix-6.0.1.tar.gz -C /usr/local/zabbix/
3.2 创建zabbix用户组和用户
创建zabbix组
groupadd zabbix
创建zabbix用户
useradd -g zabbix -M -s /sbin/nologin zabbix
3.3 编译安装zabbix
./configure --prefix=/usr/local/zabbix/ --enable-server --enable-agent --with-net-snmp --with-mysql
make install
3.4 安装php
yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum -y install yum-utils
yum-config-manager --disable 'remi-php*'
yum-config-manager --enable remi-php74
yum -y install php php-bcmath php-gd php-xml php-mbstring php-mysqlnd php-ldap
yum -y install curl-devl libxml2 libxml2-devel
4.5 修改php文件
vi /etc/php.ini
4.6 移动前端文件至web服务的根目录并授权
cp -r /usr/local/zabbix/zabbix-6.0.1/ui/* /var/www/html/
chown apache:apache /var/www/html -R
4.7 导入数据库架构及数据
mysql -uzabbix -pQwer@123 zabbix < /usr/local/zabbix/zabbix-6.0.1/database/mysql/schema.sql
mysql -uzabbix -pQwer@123 zabbix < /usr/local/zabbix/zabbix-6.0.1/database/mysql/images.sql
mysql -uzabbix -pQwer@123 zabbix < /usr/local/zabbix/zabbix-6.0.1/database/mysql/data.sql
4.8 修改配置zabbixserver文件数据库密码
vi /usr/local/zabbix/etc/zabbix_server.conf
4.9 开启zabbix服务
service httpd start
systemctl enable httpd.service
cd /usr/local/zabbix/sbin/
./zabbix_server
五、zabbix安装测试
5.1 选择安装语言
5.2 条件检测
5.3 配置mysql数据库连接
5.4 设置zabbix名称和时区
5.5 安装确认检查
5.6 下载配置文件
5.7 上传配置文件
5.8 完成
六、登录
转载来源https://blog.csdn.net/weixin_50877409/article/details/124295941?spm=1001.2100.3001.7377&utm_medium=distribute.pc_feed_blog_category.none-task-blog-classify_tag-5-124295941-null-null.nonecase&depth_1-utm_source=distribute.pc_feed_blog_category.none-task-blog-classify_tag-5-124295941-null-null.nonecase
标签:php,centos,--,zabbix,usr,mysql,7.9,local From: https://www.cnblogs.com/zgt-edu-cn/p/17030091.html