#yyds干货盘点# centos6安装zabbix
原创
©著作权归作者所有:来自51CTO博客作者qq5e3a878504161的原创作品,请联系作者获取转载授权,否则将追究法律责任
Zabbix frontend and server on RHEL 6
Zabbix frontend on RHEL 6 is not supported because of PHP version. Since Zabbix 3.0 the requirements are to have PHP 5.4.0 or later while RHEL 6 latest version is 5.3.3 .
In most cases Zabbix server and frontend are installed on the same machine. When upgrading 2.2 to 3.0 Zabbix server will perform database upgrade and frontend will stop working. There is no way to roll back the database changes so users will be forced to upgrade PHP using 3rd party packages. This is why Zabbix server is also deprecated on RHEL 6.
If you still want to use Zabbix frontend on RHEL 6 and upgraded your PHP using 3rd party packages you would need to enable zabbix-deprecated repository first:
open file /etc/yum.repos.d/zabbix.repo
find section [zabbix-deprecated]
set enabled=1
save the file
You will have to do some more manual configuration. This is because we cannot identify the Apache version required for your PHP which makes it impossible for us to provide proper Apache configuration for Zabbix frontend.
上文说从3.0开始 zabbix需要安装php5.4以上的版本,但是centos6默认版本是5.3.3,所以需要额外手工安装php
1.安装PHP包
检查当前安装的PHP包
yum list installed | grep php
如果有安装的PHP包,先删除他们
#安装php
yum -y install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64 php70w-bcmath php70w-xml php70w-xmlrpc
#安装依赖包
yum -y install gcc mysql-community-devel libxml2-devel unixODBC-devel net-snmp-devel libcurl-devel libssh2-devel OpenIPMI-devel openssl-devel openldap-devel
Some PHP settings are need configured
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 max_input_vars 10000
php_value always_populate_raw_post_data -1
date.timezone Asia/Shanghai
2.安装zabbix
rpm -ivh https://repo.zabbix.com/zabbix/4.0/rhel/6/x86_64/zabbix-release-4.0-1.el6.noarch.rpm
yum install zabbix-server-mysql zabbix-proxy-mysql zabbix-web-mysql zabbix-agent
Create initial database
documentation
mysql -uroot -p
password
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'password';
mysql> quit;
Import initial schema and data. You will be prompted to enter your newly created password.
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
Configure the database for Zabbix server
Edit file /etc/zabbix/zabbix_server.conf
DBPassword=password
创建一个新的web前端文件
[root@localhost conf]# cp -rf /usr/share/zabbix /var/www/html/
设置Apache作为Web用户接口文件的所有者
[root@localhost php]# chown -R apache:apache /var/www/html/zabbix
添加权限给Zabbix Web界面执行文件
[root@localhost php]# chmod +x /var/www/html/zabbix/conf/
添加Zabbix服务器和Zabbix代理服务
[root@localhost php]# chkconfig --add /etc/init.d/zabbix_server
[root@localhost php]# chkconfig --add /etc/init.d/zabbix_agentd
[root@localhost php]# chkconfig httpd on
[root@localhost php]# chkconfig mysqld on
[root@localhost php]# chkconfig zabbix_server on
[root@localhost php]# chkconfig zabbix_agentd on
http://172.17.17.18/zabbix/
登陆用户名:Admin
登陆密码:zabbix
php 5.4以上版本: https://www.cnblogs.com/z-books/p/6215467.html
zabbix: https://www.cnblogs.com/Tang-Yuan/p/9842429.html
zabbix office: https://www.zabbix.com/download?zabbix=4.0&os_distribution=centos&os_version=6&db=MySQL