zabbix6.2安装步骤

配置阿里云源

注意本机的操作系统的centos8

[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# rm -rf *
[root@localhost yum.repos.d]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
[root@localhost yum.repos.d]# sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
[root@localhost yum.repos.d]# yum clean all
[root@localhost yum.repos.d]# yum list all

安装httpd和mariadb*

注意PHP至少7.4,mariadb至少10.5版本

[root@localhost ~]# dnf -y install httpd
[root@localhost ~]# dnf -y module install mariadb:10.5#无法安装使用如下命令卸载后重新安装,再安装php:7.4*
[root@localhost ~]# dnf -y module reset mariadb:10.5
[root@localhost ~]# dnf -y module install mariadb:10.5
[root@localhost ~]# dnf module -y install php:7.4*#查看是否安装成功
[root@localhost ~]# rpm -qa | grep php
php-cli-7.4.30-1.module_el8.7.0+1190+d11b935a.x86_64
php-common-7.4.30-1.module_el8.7.0+1190+d11b935a.x86_64
php-mbstring-7.4.30-1.module_el8.7.0+1190+d11b935a.x86_64
php-fpm-7.4.30-1.module_el8.7.0+1190+d11b935a.x86_64
php-xml-7.4.30-1.module_el8.7.0+1190+d11b935a.x86_64
php-json-7.4.30-1.module_el8.7.0+1190+d11b935a.x86_64
[root@localhost ~]#

编译http配置文件

[root@localhost ~]# cd /etc/httpd/conf.d/
[root@localhost conf.d]# find / -name *vhosts.conf
/var/lib/containers/storage/overlay/bfc56aacd784174064eec717da729908e09fc649a3592743aa020d302b09f6ca/diff/usr/local/apache2/conf/extra/httpd-vhosts.conf
/var/lib/containers/storage/overlay/bfc56aacd784174064eec717da729908e09fc649a3592743aa020d302b09f6ca/diff/usr/local/apache2/conf/original/extra/httpd-vhosts.conf
/usr/share/doc/httpd/httpd-vhosts.conf#复制文件并修改
[root@localhost conf.d]# cp /usr/share/doc/httpd/httpd-vhosts.conf .
[root@localhost conf.d]# ls
autoindex.conf  httpd-vhosts.conf  php.conf  README  userdir.conf  welcome.conf[root@localhost conf.d]# vim httpd-vhosts.conf
#添加内容如下
<VirtualHost *:80>DocumentRoot "/var/www/html/zabbix.example.com"ServerName zabbix.example.comProxyRequests OffProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/var/www/html/zabbix.example.com/$1<Directory "/var/www/html/zabbix.example.com">Options noneAllowOverride noneRequire all granted</Directory>ErrorLog "/var/log/httpd/zabbix.example.com-error_log"CustomLog "/var/log/httpd/zabbix.example.com-access_log" common
</VirtualHost>#查看是否有IncludeOptional conf.d/*.conf
[root@localhost conf.d]# cd ..
[root@localhost httpd]# vim conf/httpd.conf
#搜索/DirectoryIndex,添加index.php
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>DirectoryIndex index.php index.html
</IfModule>#//搜索AddType,添加以下内容
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps  #创建测试页面
[root@localhost httpd]# mkdir /var/www/html/zabbix.example.com
[root@localhost httpd]# vim /var/www/html/zabbix.example.com/index.php
<?phpphpinfo();
?>#开启httpd和mariadb服务
[root@localhost ~]# systemctl enable --now httpd
[root@localhost ~]# systemctl enable --now mariadb#设置密码
[root@localhost ~]# mysql
MariaDB [(none)]> set password = password('long123!');
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> quit
Bye#测试是否可以成功登录MySQL
[root@localhost ~]# mysql -uroot -plong123!
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 10.5.9-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> quit
Bye[root@localhost ~]# systemctl enable --now php-fpm
[root@localhost ~]# systemctl status php-fpm
● php-fpm.service - The PHP FastCGI Process ManagerLoaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor preset: disabl>Active: active (running) since Thu 2022-09-01 17:25:53 CST; 8min agoMain PID: 7269 (php-fpm)#查看是否有端口没有就进入配置文件编写
[root@localhost ~]# ss -antl
State     Recv-Q    Send-Q       Local Address:Port        Peer Address:Port    Process
LISTEN    0         80                 0.0.0.0:3306             0.0.0.0:*
LISTEN    0         128                0.0.0.0:22               0.0.0.0:*
LISTEN    0         128                      *:80                     *:*
LISTEN    0         128                   [::]:22                  [::]:*                  [root@localhost ~]# vim /etc/php-fpm.d/www.conf
#把如下配置改为
listen = /run/php-fpm/www.sock
#改后
; Note: This value is mandatory.
listen = 0.0.0.0:9000
[root@localhost php-fpm.d]# systemctl restart php-fpm#重新查看端口号,可以看见端口号已经有了
[root@localhost php-fpm.d]# ss -antl
State     Recv-Q    Send-Q       Local Address:Port        Peer Address:Port    Process
LISTEN    0         128                0.0.0.0:9000             0.0.0.0:*
LISTEN    0         80                 0.0.0.0:3306             0.0.0.0:*
LISTEN    0         128                0.0.0.0:22               0.0.0.0:*
LISTEN    0         128                      *:80                     *:*
LISTEN    0         128                   [::]:22                  [::]:*
[root@localhost php-fpm.d]# #关闭防火墙
[root@localhost php-fpm.d]# systemctl disable --now firewalld
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost php-fpm.d]# setenforce 0
[root@localhost php-fpm.d]# vim /etc/selinux/config
[root@localhost php-fpm.d]# cat /etc/selinux/config | grep SELINUX=
# SELINUX= can take one of these three values:
SELINUX=disabled

测试服务php页面是否成功

zabbix服务端安装

官方网站下载地址
https://www.zabbix.com/cn/download_sources


https://www.zabbix.com/documentation/6.2/en/manual/installation/install
产品帮助文档地址如上

[root@localhost conf.d]# cd /usr/src/
[root@localhost src]# wget https://cdn.zabbix.com/zabbix/sources/stable/6.2/zabbix-6.2.2.tar.gz
....
2022-09-01 18:00:30 (5.84 MB/s) - ‘zabbix-6.2.2.tar.gz’ saved [34995538/34995538]
[root@localhost src]# ls
debug  kernels  zabbix-6.2.2.tar.gz
[root@localhost src]# //安装依赖包
[root@localhost src]# yum -y install net-snmp-devel libevent-devel
安装过程略....#解压安装包并创建用户
[root@localhost src]# tar xf zabbix-6.2.2.tar.gz
[root@localhost src]# ls
debug  kernels  zabbix-6.2.2  zabbix-6.2.2.tar.gz[root@localhost src]# useradd -r -d /usr/lib/zabbix -s /sbin/nologin -c "Zabbix Monitoring System" zabbix[root@localhost src]# mkdir -p /usr/lib/zabbix
[root@localhost src]# chmod 770 /usr/lib/zabbix
[root@localhost src]# chown -R zabbix.zabbix /usr/lib/zabbix#创建数据库
[root@localhost ~]# mysql -uroot -pzabbix123!
MariaDB [(none)]> create database zabbix character set utf8mb4 collate utf8mb4_bin;
Query OK, 1 row affected (0.000 sec)MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| zabbix             |
+--------------------+
4 rows in set (0.000 sec)MariaDB [(none)]> create user 'zabbix'@'localhost' identified by 'zabbix123!';
Query OK, 0 rows affected (0.000 sec)MariaDB [(none)]> grant all privileges on zabbix.* to 'zabbix'@'localhost';
Query OK, 0 rows affected (0.000 sec)MariaDB [(none)]> SET GLOBAL log_bin_trust_function_creators = 1;
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> flush privileges;#上传表,注意你使用的是什么安装就用什么我这里是用mysql
[root@localhost src]# cd /usr/src/zabbix-6.2.2/database/mysql#把表导入数据库中
[root@localhost mysql]# mysql -uroot -plong123! zabbix < schema.sql
[root@localhost mysql]# mysql -uroot -plong123! zabbix < images.sql
[root@localhost mysql]# mysql -uroot -plong123! zabbix < data.sql [root@localhost ~]# mysql -uroot -plong123!
MariaDB [(none)]> use zabbix
MariaDB [zabbix]> show tables;
....
| widget_field               |
+----------------------------+
176 rows in set (0.003 sec)
#必须176才是正确的
MariaDB [zabbix]> SET GLOBAL log_bin_trust_function_creators = 0;
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> quit#测试是否可以登录
[root@localhost mysql]# mysql -uzabbix -pzabbix123!
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 18
Server version: 10.5.9-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> quit[root@localhost mysql]# cd /usr/src/zabbix-6.2.2
[root@localhost zabbix-6.2.2]# dnf -y install gcc gcc-c++ libxml2-devel libcurl-devel pcre-devel openssl openssl-devel golang-bin make
[root@localhost zabbix-6.2.2]# yum install mysql-devel -y
[root@localhost zabbix-6.2.2]# ./configure --enable-server --enable-agent --with-mysql --with-libcurl --with-libxml2Enable web service:    no  #注意这里是否开启Enable Java gateway:   noLDAP support:          noIPv6 support:          no
***********************************************************
*            Now run 'make install'                       *
*                                                         *
*            Thank you for using Zabbix!                  *
*              <http://www.zabbix.com>                    *
***********************************************************
#以上是配置安装后有的配置总结,然后服务端就安装好了就,等一下上传网站的文件
[root@localhost zabbix-6.2.2]# make install
...等待,注意需要安装完成才能操作[root@localhost zabbix-6.2.2]# cd /usr/local/etc/
[root@localhost etc]# vim zabbix_server.conf
#添加数据库的密码
### Option: DBPassword
#       Database password.
#       Comment this line if no password is used.
#
# Mandatory: no
# Default:
# DBPassword=
DBPassword=zabbix123!#开启服务
[root@localhost etc]# zabbix_server
[root@localhost etc]# zabbix_agentd
[root@localhost etc]# ss -anlt
State     Recv-Q    Send-Q       Local Address:Port        Peer Address:Port    Process
LISTEN    0         128                0.0.0.0:10050            0.0.0.0:*
LISTEN    0         128                0.0.0.0:10051            0.0.0.0:*
LISTEN    0         128                0.0.0.0:9000             0.0.0.0:*
LISTEN    0         128                0.0.0.0:22               0.0.0.0:*
LISTEN    0         80                       *:3306                   *:*
LISTEN    0         128                      *:80                     *:*
LISTEN    0         128                   [::]:22                  [::]:*
[root@localhost etc]# 

zabbix服务端web界面安装与配置

[root@localhost etc]# cd /usr/src/zabbix-6.2.2/
[root@localhost zabbix-6.2.2]# ls
aclocal.m4  compile        config.sub    depcomp     Makefile     missing  ui
AUTHORS     conf           configure     include     Makefile.am  NEWS
bin         config.guess   configure.ac  INSTALL     Makefile.in  README
build       config.log     COPYING       install-sh  man          sass
ChangeLog   config.status  database      m4          misc         src
[root@localhost zabbix-6.2.2]# cp -a ui/* /var/www/html/zabbix.example.com/
cp: overwrite '/var/www/html/zabbix.example.com/index.php'? y
[root@localhost zabbix-6.2.2]# #修改属主
[root@localhost zabbix-6.2.2]# ll /var/www/
total 0
drwxr-xr-x. 2 root root  6 Nov 12  2021 cgi-bin
drwxr-xr-x. 3 root root 32 Sep  1 22:18 html
[root@localhost zabbix-6.2.2]# chown -R apache.apache /var/www/html/
[root@localhost zabbix-6.2.2]# ll /var/www/
total 0
drwxr-xr-x. 2 root   root    6 Nov 12  2021 cgi-bin
drwxr-xr-x. 3 apache apache 32 Sep  1 22:18 html
[root@localhost zabbix-6.2.2]# ll /var/www/html/
total 4
drwxr-xr-x. 13 apache apache 4096 Sep  1 23:10 zabbix.example.com
[root@localhost zabbix-6.2.2]#

页面安装前的环境安装

//修改/etc/php.ini的配置并重启php-fpm
[root@localhost ~]# sed -ri 's/(post_max_size =).*/\1 16M/g' /etc/php.ini
[root@localhost ~]# sed -ri 's/(max_execution_time =).*/\1 300/g' /etc/php.ini
[root@localhost ~]# sed -ri 's/(max_input_time =).*/\1 300/g' /etc/php.ini
[root@localhost ~]# sed -i '/;date.timezone/a date.timezone = Asia/Shanghai' /etc/php.ini
[root@localhost ~]# systemctl restart php-fpm
[root@localhost ~]# dnf -y install php-bcmath php-gd php-mysqlnd#中文安装需要的环境
[root@localhost ~]# dnf -y install glibc-common langpacks-zh_CN.noarch

web页面安装

选择语言
这里是因为我的系统没有多种语言支持,如果想安装中文需要安装中文安装需要的环境






*默认的账号名Admin
密码zabbix


登录成功

配置服务开机自启

注意这里是要在可以通过浏览器访问并进入后配置

#查看现在开启的端口
[root@localhost ~]# ss -anlt
State     Recv-Q    Send-Q       Local Address:Port        Peer Address:Port    Process
LISTEN    0         128                0.0.0.0:9000             0.0.0.0:*
LISTEN    0         128                0.0.0.0:22               0.0.0.0:*
LISTEN    0         80                       *:3306                   *:*
LISTEN    0         128                      *:80                     *:*
LISTEN    0         128                   [::]:22                  [::]:*                  #编写配置文件
[root@localhost ~]# vim /etc/rc.local
#!/bin/bash  #直接在下面添加然后保存
zabbix_server
zabbix_agentd
...#查看执行的文件然后授予执行权限,然后运行
[root@localhost ~]# ll /etc/rc.local
lrwxrwxrwx. 1 root root 13 Dec  2  2020 /etc/rc.local -> rc.d/rc.local
[root@localhost ~]# chmod +x /etc/rc.d/rc.local
[root@localhost ~]# ll /etc/rc.d/rc.local
-rwxr-xr-x. 1 root root 502 Sep  4 14:47 /etc/rc.d/rc.local
[root@localhost ~]# source /etc/rc.d/rc.local #查看端口观察服务是否开启
[root@localhost ~]# ss -anlt
State     Recv-Q    Send-Q       Local Address:Port        Peer Address:Port    Process
LISTEN    0         128                0.0.0.0:10050            0.0.0.0:*
LISTEN    0         128                0.0.0.0:10051            0.0.0.0:*
LISTEN    0         128                0.0.0.0:9000             0.0.0.0:*
LISTEN    0         128                0.0.0.0:22               0.0.0.0:*
LISTEN    0         80                       *:3306                   *:*
LISTEN    0         128                      *:80                     *:*
LISTEN    0         128                   [::]:22                  [::]:*
[root@localhost ~]#

部署zabbix6.2相关推荐

  1. Zabbix6.2这些新特性太棒了,手把书教你在Linux部署Zabbix6.2,速度收藏!

    来源:网络技术联盟站 链接:https://www.wljslmz.cn/19890.html 我们访问Zabbix官网https://www.zabbix.com/看到Zabbix最新版本是6.2: ...

  2. lnmp部署Ansible部署zabbix6.0版本

    目录标题 lnmp 架构 准备工作 部署nginx 部署 mysql 部署 PHP 使用Ansible 部署 zabbix6.0版本 准备工作 ansible 操作 配置关闭防火墙跟SElinux的p ...

  3. centos7.9 部署 zabbix6.0 + mysql (docker-compose)

    centos7.9 部署 zabbix6.0 + mysql (docker-compose) 借鉴博客: https://www.cnblogs.com/ivictor/p/16025786.htm ...

  4. docker部署zabbix6.0服务

    前言 服务器 ip 规格 相关信息 CentOS7.9 Linux localhost 3.10.0-1160.83.1.el7.x86_64 192.168.56.110 1c2g40GB dock ...

  5. docker部署zabbix6.2.7+grafana

    目录 1.下载docker 2.下载相关镜像文件 3.创建一个供zabbix系统使用的网络环境 4.创建一个供mysql数据库存放文件的目录 5.启动mysql容器 6.为zabbix-server创 ...

  6. 手把手教你在centos8操作系统上部署zabbix6.0

    实验环境 [itlaoxin@localhost ~]$ cat /etc/redhat-release CentOS Stream release 8 [itlaoxin@localhost ~]$ ...

  7. 小白虚拟机Centos8部署zabbix6.0教程

    虚拟机环境 CD镜像:CentOS-Stream-8-x86_64-20221125-dvd1.iso 关闭防火墙 ]# systemctl stop firewalld ]# systemctl d ...

  8. CENT OS 8 Stream 安装部署 Zabbix 6.0 LTS

    CENT OS 8 Stream 安装部署 Zabbix 6.0 LTS Zabbix架构 信息汇总 CentOS 8 Stream 部署Zabbix6.0 替换CentOS8源为阿里源 替换Cent ...

  9. @Zabbix6.2安装部署【 Red Hat Linux release 8.0】

    文章目录 1.版本支持官方确认 2.服务器环境 3.zabbix6.2部署 4.数据库选用 5.数据库安装及初始化 6.zabbix系统架构数据导入 7.zabbix server配置DB 8.Zab ...

最新文章

  1. c语言中成绩等级流程图画法,大家帮我看看这个程序的流程图怎么画,谢了
  2. php操作MySQL
  3. 无线对讲调度服务器,无线对讲系统---智能调度系统
  4. Java静态变量与静态方法与成员变量成员方法的区别
  5. python实验总结心得体会_Python,Pyvisa操作Agilent 86140x系列OSA
  6. python的环境变量设置
  7. 散粉在哪个步骤用_新手化妆步骤+50个美妆小技巧+化妆知识扫盲
  8. Spring自带的线程池ThreadPoolTaskExecutor
  9. [ZT]javascript window resize 窗口改变事件
  10. 基于vue2.0与追书神器api的小说阅读webapp
  11. java向指定用户极光推送_【极光推送】给指定用户发送消息
  12. Detours学习之十二:Detours API用于修改二进制文件的api
  13. 【Web】HTML基础——了解HMTL基本结构+常用标签的使用
  14. 【OpenCV】Lab颜色空间
  15. 32-Figma-谷歌表格插件替换数据方法
  16. AI 赋能教育,松鼠 AI 智适应学习方案大揭秘
  17. 网易2017春招笔试——赶去公司
  18. 深度学习相关概念:权重初始化
  19. STL--String类的常用功能复写
  20. 张勋说:棒磨机钢棒直径的配置(热处理调质耐磨钢棒)

热门文章

  1. 卡友们留意:广发信用卡分期手续费标准修改
  2. react 学习(一) 实现简版虚拟 dom 和挂载
  3. 数据结构之线性表的含义和线性表的抽象数据类型
  4. 数据分析sql面试必会6题经典_面试数据分析会遇到的SQL题
  5. Bootstrap的Layout和常见layout摆放就在这
  6. catia曲面扫掠命令详解_扫掠曲面在CATIA曲面造型中的应用
  7. 判断儒略日(一年中第几天)
  8. 一个好用的用户思维工具送给你「客户旅程」
  9. 制作ico图标的一个小软件
  10. 如何使用python3模拟icmp发包