本文共 3484 字,大约阅读时间需要 11 分钟。
Install the repository configuration package. This package contains yum configuration files.
-- 查看centos 版本cat /etc/redhat-release rpm -q centos-release-- Zabbix 2.4 for RHEL7, Oracle Linux 7, CentOS 7:sudo rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/7/x86_64/zabbix-release-2.4-1.el7.noarch.rpm
Install Zabbix packages. Example for Zabbix server and web frontend with mysql database.
Zabbix official repository provides fping, iksemel, libssh2 packages as well. These packages are located in the non-supported directory.
sudo yum install zabbix-server-mysql zabbix-web-mysqlsudo yum install zabbix-agent
ls /usr/share/doc/zabbix-server-mysql-2.4.8/create/此目录下有三个数据库脚步文件:schema.sql, images.sql and data.sql** 注意 :For a Zabbix proxy database, only schema.sql should be imported (no images.sql nor data.sql)shell> mysql -uroot -pmysql> create database zabbix character set utf8 collate utf8_bin;mysql> grant all privileges on zabbix.* to zabbix@localhost identified by ' ';mysql> quit;shell> mysql -uzabbix -p zabbix < database/mysql/schema.sql=>mysql -u zabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-2.4.8/create/schema.sql ( shell 提示 Enter password: )** 注意 :stop here if you are creating database for Zabbix proxyshell> mysql -uzabbix -p zabbix < database/mysql/images.sqlshell> mysql -uzabbix -p zabbix < database/mysql/data.sql
Edit database configuration in zabbix_server.conf
sudo vi /etc/zabbix/zabbix_server.confDBHost=localhostDBName=zabbixDBUser=zabbixDBPassword=zabbixStart Zabbix server process:sudo service zabbix-server start或者sudo systemctl start zabbix-server.service查看服务状态 systemctl status zabbix-server
Apache configuration file for Zabbix frontend is located in /etc/httpd/conf.d/zabbix.conf.
php_value max_execution_time 300php_value memory_limit 128Mphp_value post_max_size 16Mphp_value upload_max_filesize 2Mphp_value max_input_time 300#php_value date.timezone Europe/Riga -- 去掉注释,本地化为PRC
按照官网配置以上内容,启动zabbix服务,即搭建完成zabbix(zabbix站点);在浏览器访问。
1、参考手册完成安装后,在浏览器访问http://zabbix-serser-hostname(ip)/zabbix ,出现 “Forbidden ->You don't have permission to access /zabbix/ on this server.”;访问http://zabbix-serser-hostname(ip)/zabbix/index.php时,页面显示php源码。分析:apache 无法解析php网页解决方案:sudo vi /etc/httpd/conf.d/zabbix.conf添加如下配置# If php is turned on, we respect .php and .phps files.AddType application/x-httpd-php .phpAddType application/x-httpd-php-source .phps# Since most users will want index.php to work we# also automatically enable index.php 重启apache** 2、/etc/httpd/conf.d/zabbix.conf 文件**Alias /zabbix /usr/share/zabbix (zabbix php 文件目录)DirectoryIndex index.html index.php Options FollowSymLinksAllowOverride NoneRequire all granted # If php is turned on, we respect .php and .phps files. AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps
php_value max_execution_time 300 php_value memory_limit 128M php_value post_max_size 16M php_value upload_max_filesize 2M php_value max_input_time 300 php_value date.timezone PRC ## DirectoryIndex index.html index.php # Require all denied Require all denied
转载地址:http://esqko.baihongyu.com/