Centos6.5安装zabbix 3.0.4 环境篇

前端之家收集整理的这篇文章主要介绍了Centos6.5安装zabbix 3.0.4 环境篇前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

CentOS默认情况下提供了一个很老的版本的MysqL 5.1。我们需要MysqL5.6以上版本,需要删除旧版本。

  1. [root@iZ25pvjcsyhZ~]#yumlistinstalled|grepMysqL
  2. MysqL-libs.x86_645.1.73-3.el6_5@updates
  3. [root@iZ25pvjcsyhZ~]#yumremoveMysqL*

配置MysqL

  1. [root@hyg~]#rpm-ivhhttp://dev.MysqL.com/get/MysqL-community-release-el6-5.noarch.rpm
  2. Retrievinghttp://dev.MysqL.com/get/MysqL-community-release-el6-5.noarch.rpm
  3. Preparing...###########################################[100%]
  4. 1:MysqL-community-release###########################################[100%]

安装MysqL

  1. [root@hyg~]#yuminstallMysqL-server

查看MysqL版本

  1. [root@hyg~]#yumlistinstalled|grepMysqL
  2. MysqL-community-client.x86_64
  3. 5.6.32-2.el6@MysqL56-community
  4. MysqL-community-common.x86_64
  5. 5.6.32-2.el6@MysqL56-community
  6. MysqL-community-libs.x86_64
  7. 5.6.32-2.el6@MysqL56-community
  8. MysqL-community-release.noarch
  9. MysqL-community-server.x86_64
  10. 5.6.32-2.el6@MysqL56-community

修改MysqL配置文件. /etc/my.cnf,在[MysqLd]中添加innodb_file_per_table=1

  1. [root@hyg~]#vim/etc/my.cnf
  2.  
  3.  
  4. [MysqLd]
  5. datadir=/var/lib/MysqL
  6. socket=/var/lib/MysqL/MysqL.sock
  7. innodb_file_per_table=1
  8. symbolic-links=0
  9. sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
  10. [MysqLd_safe]
  11. log-error=/var/log/MysqLd.log
  12. pid-file=/var/run/MysqLd/MysqLd.pid

启动

  1. [root@hyg~]#serviceMysqLdstart

初始化安全数据库

  1. [root@hyg~]#MysqL_secure_installation

登录数据库

  1. [root@hyg~]#MysqL-uroot-p123456

数据库字符集

  1. MysqL>CREATEDATABASEzabbixCHARACTERSETutf8COLLATEutf8_bin;
  2. QueryOK,1rowaffected(0.00sec)

创建一个数据库用户,设置密码和授予特权。

  1. MysqL>GRANTALLPRIVILEGESONzabbix.*TOzabbix@localhostIDENTIFIEDBY'gz';
  2. QueryOK,0rowsaffected(0.00sec)

检查授权是否成功

  1. MysqL>showdatabases;
  2. +--------------------+
  3. |Database|
  4. +--------------------+
  5. |information_schema|
  6. |MysqL|
  7. |performance_schema|
  8. |zabbix|
  9. +--------------------+
  10. 4rowsinset(0.00sec)

Zabbix 3需要PHP5.4或更高版本。所以配置一个PHP源。

  1. [root@hyg~]#rpm-ivhhttp://repo.webtatic.com/yum/el6/latest.rpm

安装所需的包

  1. [root@hyg~]#yuminstallhttpdPHP56wPHP56w-gdPHP56w-MysqLPHP56w-bcmathPHP56w-mbstringPHP56w-xmlPHP56w-ldap

修改PHP配置

  1. [root@hyg~]#vim/etc/PHP.ini
  2. post_max_size=16M
  3. max_execution_time=300
  4. max_input_time=300
  5. date.timezone=Asia/Shanghai
  6. always_populate_raw_post_data=-1

启动web

  1. [root@hyg~]#servicehttpdstart

启用端口80上的iptables

  1. [root@hyg~]#iptables-IINPUT-ptcp--dport80-mstate--stateNEW,ESTABLISHED-jACCEPT
  2. [root@hyg~]#iptables-save>/etc/sysconfig/iptables

猜你在找的CentOS相关文章