Ubuntu 22.04 安装Zabbix 6.0 ,apache

您所在的位置:网站首页 无法定位安装包 Ubuntu 22.04 安装Zabbix 6.0 ,apache

Ubuntu 22.04 安装Zabbix 6.0 ,apache

2024-01-03 11:14| 来源: 网络整理| 查看: 265

1;下载Zabbix安装包

# wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-4%2Bubuntu22.04_all.deb # dpkg -i zabbix-release_6.0-4+ubuntu22.04_all.deb # apt update

2;安装Zabbix server,Web前端,agent

# apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent

3;初始化数据库

sudo mysql

//在sql命令行输入以下命令回车,你就可以把Root密码改成mynewpassword

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'mynewpassword';

 exit回到终端命令行,输入:

sudo mysql_secure_installation

输入刚才设置的root密码,根据提示输入Y or N:  这里可以全部选择N

VALIDATE PASSWORD PLUGIN can be used to test passwords and improve security. It checks the strength of password and allows the users to set only those passwords which are secure enough. Would you like to setup VALIDATE PASSWORD plugin? Press y|Y for Yes, any other key for No: N # 否 # 是否移除匿名用户 Remove anonymous users? (Press y|Y for Yes, any other key for No) : N # 否 ... skipping. Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. # 是否禁止 root 远程登录 Disallow root login remotely? (Press y|Y for Yes, any other key for No) : N # 否 ... skipping. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. # 是否移除 test 数据库 Remove test database and access to it? (Press y|Y for Yes, any other key for No) : N # 否 ... skipping. Reloading the privilege tables will ensure that all changes made so far will take effect immediately. # 是否立即刷新表的权限 Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y # 是 Success. All done!

4;输入root密码登陆,创建zabbix初始数据库,

mysql -uroot -p mypassword mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin; mysql> create user zabbix@localhost identified by 'password'; mysql> grant all privileges on zabbix.* to zabbix@localhost; mysql> quit;

5;导入初始架构和数据,系统将提示您输入zabbix数据库新创建的密码。

# zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix

6;为Zabbix server配置数据库,编辑配置文件

vi  /etc/zabbix/zabbix_server.conf //在129行找到 替换为zaabix数据库密码,注意需要取消该行注释 #DBPassword=password

7;启动Zabbix server和agent进程

# systemctl restart zabbix-server zabbix-agent apache2

启动Zabbix server和agent进程,并为它们设置开机自启:

# systemctl enable zabbix-server zabbix-agent apache2

8;访问http://10.0.1.177/zabbix/  进入安装zabbix安装页面,这里无中文可以在ubuntu安装下

# apt-get install language-pack-zh-hans 可以重启下zabbix #systemctl restart zabbix-server zabbix-agent apache2

安装完成后,再次刷新网页就有中文。 



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3