1.https://www.zabbix.com/download?zabbix=5.0&os_distribution=centos&os_version=7&db=mysql&ws=nginx
# rpm -Uvh # yum clean all # yum install zabbix-server-mysql zabbix-agent # yum install centos-release-scl
2.修改zabbix源,启用zabbix-frontend
[zabbix-frontend]
...
enabled=1
...
3.直接安装
# yum install zabbix-web-mysql-scl zabbix-nginx-conf-scl
4.创建数据库,尽量使用命令行,使用其他工具如果能默认collate为utf8_bin也可以
# 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> quit;
5.导入数据
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
vim /etc/zabbix/zabbix_server.conf
DBPassword=password
7.为zabbix frontend 配置php,修改为自己的端口和域名
如果已经安装有nginx或apache,则还需要修改 /etc/opt/rh/rh-nginx116/nginx/nginx.conf 修改默认端口,要不然无法启动
vim /etc/opt/rh/rh-nginx116/nginx/conf.d/zabbix.conf
listen 8088;
server_name example.com;
vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
listen.acl_users = apache,nginx
php_value[date.timezone] = PRC
8.开启zabbix server and agent,并设置开机启动
# systemctl restart zabbix-server zabbix-agent rh-nginx116-nginx rh-php72-php-fpm
# systemctl enable zabbix-server zabbix-agent rh-nginx116-nginx rh-php72-php-fpm
然后就可以访问配置的域名了,输入数据库账号密码那步可能会报错,因为没有使用命令行建库,collate 必须是 utf8_bin。
本文为看恩吧原创文章,转载无需和我联系,但请注明来自knsay.com