نصب با در نظر گرفتن دیتابیس MariaDB و php نسخه ۸.۱ انجام شده ، تایم زون تهران تنظیم شده. با توجه به تستی بودن محیط ، رمزی برای یوزر root ست نشده است.
# Download and add Zabbix 7.2 official repository
wget https://repo.zabbix.com/zabbix/7.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_7.2-1+ubuntu22.04_all.deb
sudo dpkg -i zabbix-release_7.2-1+ubuntu22.04_all.deb
sudo apt update
# Install Zabbix packages and MariaDB database server
sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent mariadb-server mariadb-client
# Enable and start MariaDB service
sudo systemctl enable --now mariadb
# Secure MariaDB installation (set root password, remove test DB, etc.)
sudo mysql_secure_installation
# Login to MariaDB as root to create the Zabbix database and user
sudo mysql -u root -p
# Inside MySQL shell, execute the following lines one by one:
CREATE DATABASE zabbix CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'your-strong-password';
GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost';
SET GLOBAL log_bin_trust_function_creators = 1;
FLUSH PRIVILEGES;
EXIT;
# Import Zabbix initial schema and data. Use lower-case database name.
zcat /usr/share/zabbix/sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
# (Optional and recommended) Remove function creators privilege after import for better security.
sudo mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 0;"
# Configure Zabbix server to connect to the database
sudo nano /etc/zabbix/zabbix_server.conf
# Change or add these values:
# DBHost=localhost
# DBName=zabbix
# DBUser=zabbix
# DBPassword=your-strong-password
# Restart all related services to apply configuration changes
sudo systemctl restart zabbix-server zabbix-agent apache2
# Enable Zabbix and Apache services to start on boot
sudo systemctl enable zabbix-server zabbix-agent apache2
# Set PHP timezone for Zabbix frontend (e.g. for Iran)
sudo nano /etc/zabbix/apache.conf
# Add or set: php_value date.timezone Asia/Tehran
# Restart Apache web server to apply PHP timezone change
sudo systemctl restart apache2
# Now, finish frontend setup in your browser: http://<server-ip>/zabbix
# (Default user: Admin / password: zabbix)
دیدگاهتان را بنویسید