zabbix6.2安装步骤
配置阿里云源
注意本机的操作系统的centos8
[root@localhost ~]
[root@localhost yum.repos.d]
[root@localhost yum.repos.d]
[root@localhost yum.repos.d]
[root@localhost yum.repos.d]
[root@localhost yum.repos.d]
安装httpd和mariadb*
注意PHP至少7.4,mariadb至少10.5版本
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
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 ~]
[root@localhost conf.d]
/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]
[root@localhost conf.d]
autoindex.conf httpd-vhosts.conf php.conf README userdir.conf welcome.conf
[root@localhost conf.d]
<VirtualHost *:80>
DocumentRoot "/var/www/html/zabbix.example.com"
ServerName zabbix.example.com
ProxyRequests Off
ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/var/www/html/zabbix.example.com/$1
<Directory "/var/www/html/zabbix.example.com">
Options none
AllowOverride none
Require all granted
</Directory>
ErrorLog "/var/log/httpd/zabbix.example.com-error_log"
CustomLog "/var/log/httpd/zabbix.example.com-access_log" common
</VirtualHost>
[root@localhost conf.d]
[root@localhost httpd]
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
[root@localhost httpd]
[root@localhost httpd]
<?php
phpinfo();
?>
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
MariaDB [(none)]> set password = password('long123!');
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> quit
Bye
[root@localhost ~]
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 ~]
[root@localhost ~]
● php-fpm.service - The PHP FastCGI Process Manager
Loaded: 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 ago
Main PID: 7269 (php-fpm)
[root@localhost ~]
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 ~]
listen = /run/php-fpm/www.sock
; Note: This value is mandatory.
listen = 0.0.0.0:9000
[root@localhost php-fpm.d]
[root@localhost php-fpm.d]
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]
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost php-fpm.d]
[root@localhost php-fpm.d]
[root@localhost php-fpm.d]
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]
[root@localhost src]
....
2022-09-01 18:00:30 (5.84 MB/s) - ‘zabbix-6.2.2.tar.gz’ saved [34995538/34995538]
[root@localhost src]
debug kernels zabbix-6.2.2.tar.gz
[root@localhost src]
//安装依赖包
[root@localhost src]
安装过程略....
[root@localhost src]
[root@localhost src]
debug kernels zabbix-6.2.2 zabbix-6.2.2.tar.gz
[root@localhost src]
[root@localhost src]
[root@localhost src]
[root@localhost src]
[root@localhost ~]
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;
[root@localhost src]
[root@localhost mysql]
[root@localhost mysql]
[root@localhost mysql]
[root@localhost ~]
MariaDB [(none)]> use zabbix
MariaDB [zabbix]> show tables;
....
| widget_field |
+----------------------------+
176 rows in set (0.003 sec)
MariaDB [zabbix]> SET GLOBAL log_bin_trust_function_creators = 0;
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> quit
[root@localhost mysql]
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]
[root@localhost zabbix-6.2.2]
[root@localhost zabbix-6.2.2]
[root@localhost zabbix-6.2.2]
Enable web service: no
Enable Java gateway: no
LDAP support: no
IPv6 support: no
***********************************************************
* Now run 'make install' *
* *
* Thank you for using Zabbix! *
* <http://www.zabbix.com> *
***********************************************************
[root@localhost zabbix-6.2.2]
...等待,注意需要安装完成才能操作
[root@localhost zabbix-6.2.2]
[root@localhost etc]
DBPassword=zabbix123!
[root@localhost etc]
[root@localhost etc]
[root@localhost etc]
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]
[root@localhost zabbix-6.2.2]
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: overwrite '/var/www/html/zabbix.example.com/index.php'? y
[root@localhost zabbix-6.2.2]
[root@localhost zabbix-6.2.2]
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]
[root@localhost zabbix-6.2.2]
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]
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 ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
web页面安装
选择语言
这里是因为我的系统没有多种语言支持,如果想安装中文需要安装中文安装需要的环境
*默认的账号名Admin
密码zabbix
登录成功
配置服务开机自启
注意这里是要在可以通过浏览器访问并进入后配置
[root@localhost ~]
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 ~]
zabbix_server
zabbix_agentd
...
[root@localhost ~]
lrwxrwxrwx. 1 root root 13 Dec 2 2020 /etc/rc.local -> rc.d/rc.local
[root@localhost ~]
[root@localhost ~]
-rwxr-xr-x. 1 root root 502 Sep 4 14:47 /etc/rc.d/rc.local
[root@localhost ~]
[root@localhost ~]
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 ~]
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)