码迷,mamicode.com
首页 > 其他好文 > 详细

Centos install zabbix

时间:2015-07-01 15:30:50      阅读:138      评论:0      收藏:0      [点我收藏+]

标签:

  1. 安装PHP、mysql
    yum install php php-cli php-common php-devel php-pear php-gd php-mbstring php-mysql php-xml mysql-server 
    更改PHP设置:
    sed -i "s/;date.timezone =/date.timezone = Asia\/Shanghai/g" /etc/php.ini
    sed -i "s#max_execution_time = 30#max_execution_time = 300#g" /etc/php.ini
    sed -i "s#post_max_size = 8M#post_max_size = 32M#g" /etc/php.ini
    sed -i "s#max_input_time = 60#max_input_time = 300#g" /etc/php.ini
    sed -i "s#memory_limit = 128M#memory_limit = 128M#g" /etc/php.ini
    sed -i "/;mbstring.func_overload = 0/ambstring.func_overload = 2\n" /etc/php.ini
  2. 安装zabbix
    rpm -Uvh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-release-2.2-1.el6.noarch.rpm
    yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-java-gateway
  3. 安装nginx
    yum -y install epel-release
    yum -y install nginx 
  4. 初始化 Mysql 数据库
    # mysql -u root -p
    # mysql> CREATE DATABASE zabbix CHARACTER SET UTF8;
    # mysql> GRANT ALL PRIVILEGES on zabbix.* to ‘zabbix‘@‘localhost‘ IDENTIFIED BY ‘SECRET_PASSWORD‘;
    # mysql> FLUSH PRIVILEGES;
    # mysql> quit
    导入zabbix的数据结构
    # mysql -u zabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-2.2.9/create/schema.sql
    # mysql -u zabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-2.2.9/create/images.sql
    # mysql -u zabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-2.2.9/create/data.sql
  5. 修改zabbix配置文件,使其能访问数据库
    # vi /etc/zabbix/zabbix_server.conf
    DBHost=localhost
    DBName=zabbix
    DBUser=zabbix
    DBPassword=zabbix
  6. 重启zabbix
    service zabbix-server start
    网站配置文件默认路径:
    /usr/share/zabbix
  7. 设置nginx能访问zabbix
    cd /usr/share/nginx/html
    ln -s /usr/share/zabbix zabbix
    删除软链接 rm -rf zabbix 注意不是 rm -rf zabbix/

  8. 官方网站:https://www.zabbix.com/documentation/2.4/manual/installation/install_from_packages

Centos install zabbix

标签:

原文地址:http://www.cnblogs.com/Mrhuangrui/p/4613226.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!