Make sure you have database server up and running.
在数据库主机上运行以下代码。
# mysql -uroot -ppassword
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;
导入初始架构和数据,系统将提示您输入新创建的密码。
# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
Disable log_bin_trust_function_creators option after importing database schema.
# mysql -uroot -ppasswordmysql> set global log_bin_trust_function_creators = 0;
mysql> quit;
为Zabbix server配置数据库
编辑配置文件
vim /etc/zabbix/zabbix_server.conf
DBPassword=password
为Zabbix前端配置PHP
编辑配置文件 /etc/opt/rh/rh-nginx116/nginx/conf.d/zabbix.conf uncomment and set 'listen' and 'server_name' directives.
vim /etc/opt/rh/rh-nginx116/nginx/conf.d/zabbix.conf
# listen 80;
# server_name example.com;
编辑配置文件 /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf add nginx to listen.acl_users directive.
vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
listen.acl_users = apache,nginx
Then uncomment and set the right timezone for you.
; php_value[date.timezone] = Asia/Shanghai
修改zabbix的nginx文件
vim /etc/opt/rh/rh-nginx116/nginx/nginx.conf
将里面的server块删掉