OS: Ubuntu 20.04 LTS
DB : MySQL
Web : Apache
zabbix: 5.0 LTS
sudo -i
wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1%2Bfocal_all.deb
dpkg -i zabbix-release_5.0-1+focal_all.deb
apt update
apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-agent
apt install mysql-server
root@km-VirtualBox:~# systemctl status mysql
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2022-12-07 21:14:45 KST; 29s ago
Main PID: 58748 (mysqld)
Status: "Server is operational"
Tasks: 39 (limit: 4588)
Memory: 361.1M
CGroup: /system.slice/mysql.service
mq58748 /usr/sbin/mysqld
12월 07 21:14:44 km-VirtualBox systemd[1]: Starting MySQL Community Server...
12월 07 21:14:45 km-VirtualBox systemd[1]: Started MySQL Community Server.
root@km-VirtualBox:~#
# mysql -uroot -p
password
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> create user zabbix@localhost identified by 'password';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> set global log_bin_trust_function_creators = 1;
mysql> quit;
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
| zabbix |
+--------------------+
5 rows in set (0.00 sec)
mysql>
mysql> quit;
root@km-VirtualBox:~# mysql -u zabbix -p
Enter password: password
root@km-VirtualBox:~# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
Enter password:
root@km-VirtualBox:~#
# mysql -uroot -p
password
mysql> set global log_bin_trust_function_creators = 0;
mysql> quit;
vi /etc/zabbix/zabbix_server.conf
DBPassword=password
vi /etc/zabbix/apache.conf
php_value date.timezone Asia/Seoul
systemctl restart zabbix-server zabbix-agent apache2
# Zabbix server 와 agent processes 재부팅시 system 재시작되면 프로세스 자동으로 시작되도록 설정
systemctl enable zabbix-server zabbix-agent apache2