Установка Zabbix 5 / Installing Zabbix 5

Опубликовано: 23 Сентябрь 2024
на канале: SystemAdmins
525
8

timedatectl set-timezone Asia/Almaty
dnf install chrony -y
systemctl enable chronyd --now
firewall-cmd --permanent --add-port={80/tcp,443/tcp,10051/tcp,10050/tcp,10050/udp,10051/udp}
firewall-cmd --reload
setenforce 0
sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config

dnf install mariadb-server -y
systemctl enable mariadb --now
mysqladmin -u root password

dnf install nginx -y
systemctl enable nginx --now
dnf install php php-fpm php-mysqli -y
nano /etc/php.ini

date.timezone = "Asia/Almaty"
max_execution_time = 300
post_max_size = 16M
max_input_time = 300


systemctl enable php-fpm --now
nano /etc/nginx/nginx.conf

http {
...
server {
listen 80 default_server;
...

location ~ \.php$ {
set $root_path /usr/share/nginx/html;
fastcgi_pass unix:/run/php-fpm/www.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $root_path$fastcgi_script_name;
include fastcgi_params;
fastcgi_param DOCUMENT_ROOT $root_path;
}
}
...
}

nginx -t
systemctl restart nginx
nano /usr/share/nginx/html/index.php
dnf install
dnf install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-get
mysql -uroot -p
CREATE DATABASE zabbix DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin;
GRANT ALL PRIVILEGES ON zabbix.* TO zabbix IDENTIFIED BY 'QAZwsx123';
\q
cd /usr/share/doc/zabbix-server-mysql
gunzip create.sql.gz
mysql -u root -p zabbix create.sql
nano /etc/zabbix/zabbix_server.conf

DBPassword=zabbixpassword
...
DBName=zabbix
...
DBUser=zabbix
...



chown apache:apache /etc/zabbix/web
systemctl enable zabbix-server --now
nano /etc/nginx/nginx.conf

server {
listen 80 default_server;
...
root /usr/share/zabbix;

location ~ \.php$ {
set $root_path /usr/share/zabbix;
...
}

systemctl restart nginx
reboot


systemctl status zabbix-server

Admin
zabbix